aboutsummaryrefslogtreecommitdiffhomepage
path: root/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m')
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m51
1 files changed, 51 insertions, 0 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m
new file mode 100644
index 00000000..d7621dd0
--- /dev/null
+++ b/example/ios/iOS UI Test/iOS UI Test/SettingsViewController.m
@@ -0,0 +1,51 @@
+//
+// SettingsViewController.m
+// iOS UI Test
+//
+// Created by Jonathan Willing on 4/8/13.
+// Copyright (c) 2013 AppJon. All rights reserved.
+//
+
+#import "SettingsViewController.h"
+#import "FXKeychain.h"
+
+NSString * const UsernameKey = @"username";
+NSString * const PasswordKey = @"password";
+
+@interface SettingsViewController ()
+
+@end
+
+@implementation SettingsViewController
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)done:(id)sender {
+ [[NSUserDefaults standardUserDefaults] setObject:self.emailTextField.text forKey:UsernameKey];
+ [FXKeychain defaultKeychain][PasswordKey] = self.passwordTextField.text;
+
+ [self.delegate settingsViewControllerFinished:self];
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ self.view.backgroundColor = [UIColor underPageBackgroundColor];
+ self.emailTextField.text = [[NSUserDefaults standardUserDefaults] stringForKey:UsernameKey];
+ self.passwordTextField.text = [FXKeychain defaultKeychain][PasswordKey];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+@end