From 02aca405c6ac987cf6e50a4b8d032543435e688b Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 28 Jul 2016 16:09:07 +0200 Subject: [PATCH] 1 --- Classes/AssistantView.m | 14 +++++--------- Classes/LinphoneUI/UIAssistantTextField.h | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 853fd289c..034391d80 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -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]; diff --git a/Classes/LinphoneUI/UIAssistantTextField.h b/Classes/LinphoneUI/UIAssistantTextField.h index 37c81105e..dcebf6135 100644 --- a/Classes/LinphoneUI/UIAssistantTextField.h +++ b/Classes/LinphoneUI/UIAssistantTextField.h @@ -12,7 +12,8 @@ typedef BOOL (^DisplayErrorPred)(NSString *inputEntry); @interface UIAssistantTextField : UITextField -@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;