Commissioned
1. Going to start editing
-(BOOL) textfieldshouldbeginediting: (Uitextfield *) TextField
{
return YES;
}
2.
-(void) textfielddidbeginediting: (Uitextfield *) textfield{ //triggered when editing starts, text field will become first responder}3.-(BOOL) textfieldshouldendediting: (Uitextfield *) textfield{ //returns a BOOL value, Specifies whether the text field is allowed to end editing, and when the edit is finished, the text field yields first responder //to prevent the text field from disappearing when the user finishes editing, you can return no //This is useful for programs where text fields must always remain active, such as instant messaging return NO; 4.-(BOOL) TextField: (uitextfield*) TextField Shouldchangecharactersinrange: (nsrange) Range replacementstring :(NSString *) string{ //This method is called when the user uses the AutoCorrect feature to modify the input text to the recommended text. //This is especially useful for applications that want to join the Undo option //can track the last modification made in a field, or log records of all edits for auditing purposes. //to prevent text from being changed you can return no //this method has a Nsrange object that indicates the position of the changed text , it is suggested that the modified text is also in which return YES;} 5.-(BOOL) Textfieldshouldclear: (Uitextfield *) textfield{ //returns a BOOL value indicating whether to allow content to be purged based on user request //can be set in a specificAllow the content to be cleared return YES;} 6.-(BOOL) Textfieldshouldreturn: (Uitextfield *) textfield{ //returns a BOOL value indicating whether the edit is allowed to end when the ENTER key is pressed //If you allow the Resignfirstresponder method to be called, this causes the end of the edit, and the keyboard is closed [textfield resignfirstresponder];//check resign The meaning of this word to understand this method return YES;} To set up a proxy:mytextfield.delegate=self;
IOS Uitextfield Usage Introduction