I want to move the view when TextField is clicked but it works only on textDidChange when we change text or write anything so how to call method when we click the TextField.
-(void)textFieldTextDidChange:(UITextField*)tf{
[self showAnimationPests];
}
-(void) showAnimationPests{
[UIView animateWithDuration:0.5
animations:^{
self.view.frame = CGRectMake(0,-300,1024,768);
}];
}
instead of textchange i want on textfield click
In .h file
IBOutlet UIButton*button1;
IBOutlet UIButton*button2;
IBOutlet UIButton*button3;
IBOutlet UIButton*button4;
IBOutlet UIButton*button5;
IBOutlet UIButton*button6;
IBOutlet UIButton*button7;
IBOutlet UIButton*button8;
IBOutlet UIButton*button9;
IBOutlet UIButton*button10;
@property(nonatomic,retain)IBOutlet UIButton*button1;
@property(nonatomic,retain)IBOutlet UIButton*button2;
@property(nonatomic,retain)IBOutlet UIButton*button3;
@property(nonatomic,retain)IBOutlet UIButton*button4;
@property(nonatomic,retain)IBOutlet UIButton*button5;
@property(nonatomic,retain)IBOutlet UIButton*button6;
@property(nonatomic,retain)IBOutlet UIButton*button7;
@property(nonatomic,retain)IBOutlet UIButton*button8;
@property(nonatomic,retain)IBOutlet UIButton*button9;
@property(nonatomic,retain)IBOutlet UIButton*button10;
Use
delegate method. It is called when
UITextFieldbecomes the first responder. The moment you click in your textfield this method gets called.