textFieldDidEndEditing: called when the text field resigns as the first responder. This way you can get the entered value from the user.
textFieldShouldendEditing: used to check whether the key entered by the user should be displayed in the text field or not. Therefore, if you return NO, the key is not displayed. Imagine a shortcut in which you want to limit the number of letters entered. You can use the above to check how many characters are entered, and if they have reached the limit, return a value of NO , which basically does not take any new strokes.
You can check the reference document for more information.
source share