From 9364966a041cd85a3ee4ff9c70324446a46a6414 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Tue, 7 Jan 2014 12:23:58 +0000 Subject: iOS: update the form filling dialogs to avoid the keyboard hiding the buttons Also bring up the keyboard automatically --- platform/ios/Classes/MuChoiceFieldController.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'platform/ios/Classes/MuChoiceFieldController.m') diff --git a/platform/ios/Classes/MuChoiceFieldController.m b/platform/ios/Classes/MuChoiceFieldController.m index d32383b6..d4806dbf 100644 --- a/platform/ios/Classes/MuChoiceFieldController.m +++ b/platform/ios/Classes/MuChoiceFieldController.m @@ -8,7 +8,9 @@ #import "MuChoiceFieldController.h" @interface MuChoiceFieldController () - +- (IBAction)onCancel:(id)sender; +- (IBAction)onOkay:(id)sender; +@property (retain, nonatomic) IBOutlet UIPickerView *picker; @end @implementation MuChoiceFieldController @@ -20,7 +22,7 @@ { okayBlock = Block_copy(block); choices = [_choices retain]; - selected = -1; + selected = 0; } return self; } @@ -67,14 +69,14 @@ selected = row; } -- (IBAction)okayTapped:(id)sender +- (IBAction)onOkay:(id)sender { - if (selected > -1) + if (selected >= 0 && selected < [choices count]) okayBlock([NSArray arrayWithObject:[choices objectAtIndex:selected]]); [self dismissViewControllerAnimated:YES completion:nil]; } -- (IBAction)cancelTapped:(id)sender +- (IBAction)onCancel:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } -- cgit v1.2.3