Note that your TextField library is named txtField
and then UITextField Delegate using
txtField.delegate = self;
Given that your ScrollView socket is called scrollView
. Implement the Textfield delegate method:
- (void)textFieldDidBeginEditing:(UITextField *)textField { NSLog(@"%@",NSStringFromCGRect(textField.frame)); [scrollView scrollRectToVisible:textField.frame animated:YES]; }
Hope this helps.
Let me know if you need more help.
source share