Answer the question
In order to leave comments, you need to log in
Xcode Textfield: Validate text entered into Textfield?
Hello, I am not an application developer, but for everyday needs I use X-code to build applications for my students through the Main.Storyboard user interface. I do tests for them, which so far only required the output of a window: right or wrong. Now it was necessary to make sure that when typing text into the Textfield, the application checks against the predefined information: true or false and shows the button: Correct or Incorrect.
I would be grateful for any useful information on the merits, links to lessons, including paid ones. If you could explain in simple Russian and on your fingers how to do this, you would also be very grateful.
Answer the question
In order to leave comments, you need to log in
- (void)viewDidLoad
{
[super viewDidLoad];
// Вся магия в этой строчке
[myTextField addTarget:self action:@selector(checkTextfieldValue) forControlEvents:UIControlEventEditingChanged];
}
- (void)checkTextfieldValue
{
// тут производим проверку и работаем с интерфейсом
}
@end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question