aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorGravatar Paul Young <paulyoungonline@gmail.com>2013-06-22 16:26:43 -0400
committerGravatar Paul Young <paulyoungonline@gmail.com>2013-06-22 16:56:25 -0400
commite4cb9c41ebc8de388da788e4825eaef3ffc5f525 (patch)
tree8d9a2e3ccf7dd10e9c34d77ed71ed1a46633c248 /example
parentcf3d7e5b4438eb47973ca7dc1a657cd18e5a12dd (diff)
Added switch to settings view controller.
* Removed setting of user default in app delegate.
Diffstat (limited to 'example')
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/AppDelegate.m1
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/SettingsViewController.h2
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m3
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/SettingsViewController.xib235
4 files changed, 228 insertions, 13 deletions
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<SettingsViewControllerDelegate> 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 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
- <string key="IBDocument.SystemVersion">12D78</string>
+ <string key="IBDocument.SystemVersion">12E55</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
- <string key="IBDocument.AppKitVersion">1187.37</string>
+ <string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -14,8 +14,10 @@
<string>IBNSLayoutConstraint</string>
<string>IBProxyObject</string>
<string>IBUIBarButtonItem</string>
+ <string>IBUILabel</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationItem</string>
+ <string>IBUISwitch</string>
<string>IBUITextField</string>
<string>IBUIView</string>
</array>
@@ -136,7 +138,7 @@
<string key="NSFrame">{{20, 142}, {280, 30}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="484795553"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -159,6 +161,44 @@
<reference key="IBUIFontDescription" ref="985700861"/>
<reference key="IBUIFont" ref="649714166"/>
</object>
+ <object class="IBUISwitch" id="348875194">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{208, 180}, {94, 27}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ </object>
+ <object class="IBUILabel" id="484795553">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 183}, {143, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="348875194"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Fetch full message</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ <string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">0</int>
+ <reference key="IBUIFontDescription" ref="985700861"/>
+ <reference key="IBUIFont" ref="649714166"/>
+ <bool key="IBUIAdjustsFontSizeToFit">NO</bool>
+ </object>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<reference key="NSSuperview"/>
@@ -193,14 +233,6 @@
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">view</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="191373211"/>
- </object>
- <int key="connectionID">3</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">emailTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="339913914"/>
@@ -224,6 +256,22 @@
<int key="connectionID">55</int>
</object>
<object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">fetchFullMessageSwitch</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="348875194"/>
+ </object>
+ <int key="connectionID">68</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">69</int>
+ </object>
+ <object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">done:</string>
<reference key="source" ref="38144743"/>
@@ -244,6 +292,70 @@
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
+ <object class="IBNSLayoutConstraint" id="148058045">
+ <reference key="firstItem" ref="348875194"/>
+ <int key="firstAttribute">3</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="394260873"/>
+ <int key="secondAttribute">4</int>
+ <float key="multiplier">1</float>
+ <object class="IBNSLayoutSymbolicConstant" key="constant">
+ <double key="value">8</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="191373211"/>
+ <int key="scoringType">6</int>
+ <float key="scoringTypeFloat">24</float>
+ <int key="contentType">3</int>
+ </object>
+ <object class="IBNSLayoutConstraint" id="719571487">
+ <reference key="firstItem" ref="191373211"/>
+ <int key="firstAttribute">6</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="348875194"/>
+ <int key="secondAttribute">6</int>
+ <float key="multiplier">1</float>
+ <object class="IBNSLayoutSymbolicConstant" key="constant">
+ <double key="value">20</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="191373211"/>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ </object>
+ <object class="IBNSLayoutConstraint" id="918242346">
+ <reference key="firstItem" ref="484795553"/>
+ <int key="firstAttribute">10</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="348875194"/>
+ <int key="secondAttribute">10</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">0.0</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="191373211"/>
+ <int key="scoringType">6</int>
+ <float key="scoringTypeFloat">24</float>
+ <int key="contentType">2</int>
+ </object>
+ <object class="IBNSLayoutConstraint" id="342906512">
+ <reference key="firstItem" ref="484795553"/>
+ <int key="firstAttribute">5</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="191373211"/>
+ <int key="secondAttribute">5</int>
+ <float key="multiplier">1</float>
+ <object class="IBNSLayoutSymbolicConstant" key="constant">
+ <double key="value">20</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="191373211"/>
+ <int key="scoringType">8</int>
+ <float key="scoringTypeFloat">29</float>
+ <int key="contentType">3</int>
+ </object>
<object class="IBNSLayoutConstraint" id="1036238214">
<reference key="firstItem" ref="191373211"/>
<int key="firstAttribute">6</int>
@@ -440,6 +552,8 @@
<reference ref="339913914"/>
<reference ref="923634912"/>
<reference ref="394260873"/>
+ <reference ref="348875194"/>
+ <reference ref="484795553"/>
</array>
<reference key="parent" ref="0"/>
</object>
@@ -551,6 +665,80 @@
<reference key="object" ref="1036238214"/>
<reference key="parent" ref="191373211"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="348875194"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="719571487"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="148058045"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">59</int>
+ <reference key="object" ref="484795553"/>
+ <array class="NSMutableArray" key="children">
+ <object class="IBNSLayoutConstraint" id="269062633">
+ <reference key="firstItem" ref="484795553"/>
+ <int key="firstAttribute">8</int>
+ <int key="relation">0</int>
+ <nil key="secondItem"/>
+ <int key="secondAttribute">0</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">21</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="484795553"/>
+ <int key="scoringType">3</int>
+ <float key="scoringTypeFloat">9</float>
+ <int key="contentType">1</int>
+ </object>
+ <object class="IBNSLayoutConstraint" id="670227139">
+ <reference key="firstItem" ref="484795553"/>
+ <int key="firstAttribute">7</int>
+ <int key="relation">0</int>
+ <nil key="secondItem"/>
+ <int key="secondAttribute">0</int>
+ <float key="multiplier">1</float>
+ <object class="IBLayoutConstant" key="constant">
+ <double key="value">143</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="484795553"/>
+ <int key="scoringType">3</int>
+ <float key="scoringTypeFloat">9</float>
+ <int key="contentType">1</int>
+ </object>
+ </array>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">60</int>
+ <reference key="object" ref="342906512"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">61</int>
+ <reference key="object" ref="918242346"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">70</int>
+ <reference key="object" ref="670227139"/>
+ <reference key="parent" ref="484795553"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">71</int>
+ <reference key="object" ref="269062633"/>
+ <reference key="parent" ref="484795553"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -572,6 +760,10 @@
<reference ref="457196062"/>
<reference ref="662191761"/>
<reference ref="1036238214"/>
+ <reference ref="342906512"/>
+ <reference ref="918242346"/>
+ <reference ref="719571487"/>
+ <reference ref="148058045"/>
</array>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -594,13 +786,27 @@
<string key="52.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="53.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="54.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <boolean value="NO" key="56.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
+ <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="59.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <array key="59.IBViewMetadataConstraints">
+ <reference ref="670227139"/>
+ <reference ref="269062633"/>
+ </array>
+ <boolean value="NO" key="59.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
+ <string key="60.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="61.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="70.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="71.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">55</int>
+ <int key="maxID">71</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -628,6 +834,7 @@
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="emailTextField">UITextField</string>
+ <string key="fetchFullMessageSwitch">UISwitch</string>
<string key="hostnameTextField">UITextField</string>
<string key="passwordTextField">UITextField</string>
</dictionary>
@@ -636,6 +843,10 @@
<string key="name">emailTextField</string>
<string key="candidateClassName">UITextField</string>
</object>
+ <object class="IBToOneOutletInfo" key="fetchFullMessageSwitch">
+ <string key="name">fetchFullMessageSwitch</string>
+ <string key="candidateClassName">UISwitch</string>
+ </object>
<object class="IBToOneOutletInfo" key="hostnameTextField">
<string key="name">hostnameTextField</string>
<string key="candidateClassName">UITextField</string>