| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // OfflineSettingViewController.m
- // iSales-NPD
- //
- // Created by Ray on 5/11/16.
- // Copyright © 2016 United Software Applications, Inc. All rights reserved.
- //
- #import "OfflineSettingViewController.h"
- @interface OfflineSettingViewController ()
- @end
- @implementation OfflineSettingViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
-
-
- NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
- bool offline = [defaults boolForKey:@"EnableOfflineMode"] ;
-
- self.switch_offline.on = offline;
-
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (IBAction)onChangeOfflineSwitch:(id)sender {
-
- NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
- [defaults removeObjectForKey:@"EnableOfflineMode"];
- [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
-
- [defaults synchronize];
-
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|