From e4cb9c41ebc8de388da788e4825eaef3ffc5f525 Mon Sep 17 00:00:00 2001 From: Paul Young Date: Sat, 22 Jun 2013 16:26:43 -0400 Subject: Added switch to settings view controller. * Removed setting of user default in app delegate. --- example/ios/iOS UI Test/iOS UI Test/AppDelegate.m | 1 - .../iOS UI Test/SettingsViewController.h | 2 + .../iOS UI Test/SettingsViewController.m | 3 + .../iOS UI Test/SettingsViewController.xib | 235 +++++++++++++++++++-- 4 files changed, 228 insertions(+), 13 deletions(-) (limited to 'example') diff --git a/example/ios/iOS UI Test/iOS UI Test/AppDelegate.m b/example/ios/iOS UI Test/iOS UI Test/AppDelegate.m index 92585ffb..557653f7 100644 --- a/example/ios/iOS UI Test/iOS UI Test/AppDelegate.m +++ b/example/ios/iOS UI Test/iOS UI Test/AppDelegate.m @@ -13,7 +13,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"FetchFullMessageEnabled"]; return YES; } diff --git a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.h b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.h index 2172b4d4..e5f5da48 100644 --- a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.h +++ b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.h @@ -11,6 +11,7 @@ extern NSString * const UsernameKey; extern NSString * const PasswordKey; extern NSString * const HostnameKey; +extern NSString * const FetchFullMessageKey; @protocol SettingsViewControllerDelegate; @@ -19,6 +20,7 @@ extern NSString * const HostnameKey; @property (weak, nonatomic) IBOutlet UITextField *emailTextField; @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; @property (weak, nonatomic) IBOutlet UITextField *hostnameTextField; +@property (weak, nonatomic) IBOutlet UISwitch *fetchFullMessageSwitch; @property (nonatomic, weak) id delegate; - (IBAction)done:(id)sender; diff --git a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m index 6fbd6db2..f897b0d5 100644 --- a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m +++ b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m @@ -12,6 +12,7 @@ NSString * const UsernameKey = @"username"; NSString * const PasswordKey = @"password"; NSString * const HostnameKey = @"hostname"; +NSString * const FetchFullMessageKey = @"FetchFullMessageEnabled"; @implementation SettingsViewController @@ -19,6 +20,7 @@ NSString * const HostnameKey = @"hostname"; [[NSUserDefaults standardUserDefaults] setObject:self.emailTextField.text ?: @"" forKey:UsernameKey]; [[FXKeychain defaultKeychain] setObject:self.passwordTextField.text ?: @"" forKey:PasswordKey]; [[NSUserDefaults standardUserDefaults] setObject:self.hostnameTextField.text ?: @"" forKey:HostnameKey]; + [[NSUserDefaults standardUserDefaults] setBool:[self.fetchFullMessageSwitch isOn] forKey:FetchFullMessageKey]; [self.delegate settingsViewControllerFinished:self]; } @@ -30,6 +32,7 @@ NSString * const HostnameKey = @"hostname"; self.emailTextField.text = [[NSUserDefaults standardUserDefaults] stringForKey:UsernameKey]; self.passwordTextField.text = [[FXKeychain defaultKeychain] objectForKey:PasswordKey]; self.hostnameTextField.text = [[NSUserDefaults standardUserDefaults] stringForKey:HostnameKey]; + self.fetchFullMessageSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:FetchFullMessageKey]; } @end diff --git a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.xib b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.xib index 00041150..3de561bd 100644 --- a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.xib +++ b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.xib @@ -2,9 +2,9 @@ 1552 - 12D78 + 12E55 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -14,8 +14,10 @@ IBNSLayoutConstraint IBProxyObject IBUIBarButtonItem + IBUILabel IBUINavigationBar IBUINavigationItem + IBUISwitch IBUITextField IBUIView @@ -136,7 +138,7 @@ {{20, 142}, {280, 30}} - + _NS:9 NO YES @@ -159,6 +161,44 @@ + + + 292 + {{208, 180}, {94, 27}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + + + + 292 + {{20, 183}, {143, 21}} + + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + Fetch full message + + 1 + MCAwIDAAA + darkTextColor + + + 0 + + + NO + {{0, 20}, {320, 548}} @@ -191,14 +231,6 @@ - - - view - - - - 3 - emailTextField @@ -223,6 +255,22 @@ 55 + + + fetchFullMessageSwitch + + + + 68 + + + + view + + + + 69 + done: @@ -244,6 +292,70 @@ 1 + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + 6 @@ -440,6 +552,8 @@ + + @@ -551,6 +665,80 @@ + + 56 + + + + + 57 + + + + + 58 + + + + + 59 + + + + + 8 + 0 + + 0 + 1 + + 21 + + 1000 + + 3 + 9 + 1 + + + + 7 + 0 + + 0 + 1 + + 143 + + 1000 + + 3 + 9 + 1 + + + + + + 60 + + + + + 61 + + + + + 70 + + + + + 71 + + + @@ -572,6 +760,10 @@ + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -594,13 +786,27 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 55 + 71 @@ -628,6 +834,7 @@ UITextField + UISwitch UITextField UITextField @@ -636,6 +843,10 @@ emailTextField UITextField + + fetchFullMessageSwitch + UISwitch + hostnameTextField UITextField -- cgit v1.2.3