From 997de1638c32be2084ab5f09ed835bc9a804d9a6 Mon Sep 17 00:00:00 2001 From: Graham Perks Date: Mon, 22 Feb 2016 16:10:26 -0600 Subject: [PATCH] Make selectNextField public, and hook up the keyboard Next button. --- BSKeyboardControls/BSKeyboardControls.h | 5 + Example/Example/ViewController.m | 6 + .../en.lproj/MainStoryboard_iPad.storyboard | 126 +++++++----------- .../en.lproj/MainStoryboard_iPhone.storyboard | 126 +++++++----------- 4 files changed, 109 insertions(+), 154 deletions(-) mode change 100644 => 100755 BSKeyboardControls/BSKeyboardControls.h mode change 100644 => 100755 Example/Example/ViewController.m mode change 100644 => 100755 Example/Example/en.lproj/MainStoryboard_iPad.storyboard mode change 100644 => 100755 Example/Example/en.lproj/MainStoryboard_iPhone.storyboard diff --git a/BSKeyboardControls/BSKeyboardControls.h b/BSKeyboardControls/BSKeyboardControls.h old mode 100644 new mode 100755 index 4e715e5..5b6b234 --- a/BSKeyboardControls/BSKeyboardControls.h +++ b/BSKeyboardControls/BSKeyboardControls.h @@ -99,6 +99,11 @@ typedef NS_ENUM(NSUInteger, BSKeyboardControlsDirection) */ - (id)initWithFields:(NSArray *)fields; +/** + Makes the next field the first responder. + */ +- (void)selectNextField; + @end @protocol BSKeyboardControlsDelegate diff --git a/Example/Example/ViewController.m b/Example/Example/ViewController.m old mode 100644 new mode 100755 index 3575bfa..e65f5ed --- a/Example/Example/ViewController.m +++ b/Example/Example/ViewController.m @@ -81,6 +81,12 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField [self.keyboardControls setActiveField:textField]; } +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [self.keyboardControls selectNextField]; + return YES; +} + #pragma mark - #pragma mark Text View Delegate diff --git a/Example/Example/en.lproj/MainStoryboard_iPad.storyboard b/Example/Example/en.lproj/MainStoryboard_iPad.storyboard old mode 100644 new mode 100755 index 987bfb0..9e48e94 --- a/Example/Example/en.lproj/MainStoryboard_iPad.storyboard +++ b/Example/Example/en.lproj/MainStoryboard_iPad.storyboard @@ -1,89 +1,87 @@ - + - + + - - + + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + @@ -97,82 +95,78 @@ - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + @@ -186,30 +180,28 @@ - - + - + - - + + - - + @@ -235,24 +227,4 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/Example/Example/en.lproj/MainStoryboard_iPhone.storyboard b/Example/Example/en.lproj/MainStoryboard_iPhone.storyboard old mode 100644 new mode 100755 index 14cd054..a63fba7 --- a/Example/Example/en.lproj/MainStoryboard_iPhone.storyboard +++ b/Example/Example/en.lproj/MainStoryboard_iPhone.storyboard @@ -1,89 +1,87 @@ - + - + + - - + + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + @@ -94,82 +92,78 @@ - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + @@ -183,30 +177,28 @@ - - + - + - - + + - - + @@ -232,24 +224,4 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file +