This commit is contained in:
Gautier Pelloux-Prayer 2016-07-28 16:09:07 +02:00
parent 9512009150
commit 02aca405c6
2 changed files with 7 additions and 10 deletions

View file

@ -813,17 +813,13 @@ void assistant_activate_phone_number_link(LinphoneAccountCreator *creator, Linph
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
UIAssistantTextField *atf = (UIAssistantTextField *)textField;
[textField resignFirstResponder];
if (textField.returnKeyType == UIReturnKeyNext) {
// text fields must be ordored by increasing tag value
NSInteger tag = textField.tag + 1;
while (tag < ViewElement_NextButton) {
UIView *v = [self.view viewWithTag:tag];
if ([v isKindOfClass:UITextField.class]) {
[v becomeFirstResponder];
break;
}
tag++;
if (atf.nextResponder) {
[atf.nextResponder becomeFirstResponder];
} else {
[[self findButton:ViewElement_NextButton] sendActionsForControlEvents:UIControlEventTouchUpInside];
}
} else if (textField.returnKeyType == UIReturnKeyDone) {
[[self findButton:ViewElement_NextButton] sendActionsForControlEvents:UIControlEventTouchUpInside];

View file

@ -12,7 +12,8 @@ typedef BOOL (^DisplayErrorPred)(NSString *inputEntry);
@interface UIAssistantTextField : UITextField <UITextFieldDelegate>
@property(nonatomic, strong) IBOutlet UILabel *errorLabel;
@property(nonatomic, weak) IBOutlet UIView* nextResponder;
@property(nonatomic, weak) IBOutlet UILabel *errorLabel;
@property(nonatomic, readonly) DisplayErrorPred showErrorPredicate;
@property(nonatomic, strong) NSString *lastText;