In objective-c I have an app that when you open one of the textfield it scrolls to that field though I can only manage to do that with one element as when I try and combine multiple into one it doesn't let me. Here is the code of the identifyer:
@property (weak, nonatomic) IBOutlet UITextField *textField;
Though my scrolling is working fine I can't asign two elements to @property (weak, nonatomic) IBOutlet UITextField *textField;
Is there a way to do it and if so how
Here is my scrolling code:
.m:
- (void)textFieldDidBeginEditing:(UITextField *)sender {
svos = _scrollView.contentOffset;
CGPoint pt;
CGRect rc = [sender bounds];
rc = [sender convertRect:rc toView:_scrollView];
pt = rc.origin;
pt.x = 0;
pt.y -= 60;
[_scrollView setContentOffset:pt animated:YES];
}
- (IBAction)textFieldShouldReturn:(UITextField *)textField {
[_scrollView setContentOffset:svos animated:YES];
[textField resignFirstResponder];
}
.h:
CGPoint svos;