|
|
@@ -21,11 +21,118 @@
|
|
|
return loginVC;
|
|
|
}
|
|
|
|
|
|
+- (void)viewDidLoad
|
|
|
+{
|
|
|
+ [super viewDidLoad];
|
|
|
+ [self.checkSavePassword setImage:[UIImage imageNamed:@"unchecked_32.png"] forState:UIControlStateNormal];
|
|
|
+ [self.checkSavePassword setImage:[UIImage imageNamed:@"checked_32.png"] forState:UIControlStateSelected];
|
|
|
+
|
|
|
+
|
|
|
+ self.editUser.delegate = self;
|
|
|
+ self.editPassword.delegate = self;
|
|
|
+ self.resize = false;
|
|
|
+ self.ioffset = 0;
|
|
|
+
|
|
|
+
|
|
|
+ self.title=@"Login";
|
|
|
+
|
|
|
+
|
|
|
+ [self.checkSavePassword addTarget:self action:@selector(checkboxClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ // [self.view addSubview:checkSavePassword];
|
|
|
+ // Do any additional setup after loading the view, typically from a nib.
|
|
|
+
|
|
|
+ self.mum.backgroundColor = [UIColor clearColor];
|
|
|
+
|
|
|
+ NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
|
|
|
+
|
|
|
+ NSString* shortNum =[infoDict objectForKey:@"CFBundleShortVersionString"];
|
|
|
+ NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
|
|
|
+ versionNum = [NSString stringWithFormat:@"ver:%@.A%@",shortNum,versionNum];
|
|
|
+
|
|
|
+ self.verLabel.text = versionNum;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewWillAppear:(BOOL)animated {
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+
|
|
|
+ NSString * user = RASingleton.sharedInstance.savedUser;
|
|
|
+ NSString *password = RASingleton.sharedInstance.savedPassword;
|
|
|
+
|
|
|
+ if(user.length>0&&password.length>0)
|
|
|
+ {
|
|
|
+ self.editUser.text=user;
|
|
|
+ self.editPassword.text=password;
|
|
|
+ self.checkSavePassword.selected=true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ [self clearNavigationbar];
|
|
|
+ [self configureNavigationBar];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewDidAppear:(BOOL)animated {
|
|
|
+
|
|
|
+ [super viewDidAppear:animated];
|
|
|
+
|
|
|
+// if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeNone) {
|
|
|
+
|
|
|
+ UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Apex & Drivers need background send location" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
+
|
|
|
+ UIAlertAction *rejectAction = [UIAlertAction actionWithTitle:@"Reject" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ RASingleton.sharedInstance.backgroundReportType = RABackgroundReportTypeReject;
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIAlertAction *alwaysAction = [UIAlertAction actionWithTitle:@"Always ask" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ RASingleton.sharedInstance.backgroundReportType = RABackgroundReportTypeAlways;
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIAlertAction *allowAction = [UIAlertAction actionWithTitle:@"Allow" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+ RASingleton.sharedInstance.backgroundReportType = RABackgroundReportTypeAllow;
|
|
|
+ }];
|
|
|
+
|
|
|
+ [alertVC addAction:rejectAction];
|
|
|
+ [alertVC addAction:alwaysAction];
|
|
|
+ [alertVC addAction:allowAction];
|
|
|
+
|
|
|
+ [self presentViewController:alertVC animated:YES completion:nil];
|
|
|
+
|
|
|
+// }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)didReceiveMemoryWarning {
|
|
|
+ [super didReceiveMemoryWarning];
|
|
|
+ // Dispose of any resources that can be recreated.
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - Config
|
|
|
+
|
|
|
+- (void)clearNavigationbar {
|
|
|
+ self.tabBarController.navigationItem.leftBarButtonItem = nil;
|
|
|
+ self.tabBarController.navigationItem.leftBarButtonItems = nil;
|
|
|
+ self.tabBarController.navigationItem.titleView = nil;
|
|
|
+ self.tabBarController.navigationItem.title = nil;
|
|
|
+ self.tabBarController.navigationItem.rightBarButtonItem = nil;
|
|
|
+ self.tabBarController.navigationItem.rightBarButtonItems = nil;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)configureNavigationBar {
|
|
|
+
|
|
|
+ if (self.navigationController && !self.navigationController.isNavigationBarHidden) {
|
|
|
+
|
|
|
+ UIImage *logo = [[UIImage imageNamed:@"apexlogo-2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
|
|
+ UIBarButtonItem *logoItem = [[UIBarButtonItem alloc] initWithImage:logo landscapeImagePhone:logo style:UIBarButtonItemStylePlain target:nil action:nil];
|
|
|
+ logoItem.enabled = NO;
|
|
|
+ self.tabBarController.navigationItem.leftBarButtonItem = logoItem;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (void)clear {
|
|
|
self.editPassword.text = nil;
|
|
|
self.editUser.text = nil;
|
|
|
}
|
|
|
|
|
|
+#pragma mark - Action
|
|
|
+
|
|
|
- (IBAction)RetrieveButtonClick:(UIButton *)sender {
|
|
|
// [self performSegueWithIdentifier:@"RETRIEVE" sender:self];
|
|
|
|
|
|
@@ -137,81 +244,7 @@
|
|
|
//- (IBAction)onRetrievePassword:(UIButton *)sender {
|
|
|
//}
|
|
|
|
|
|
-- (void)viewDidLoad
|
|
|
-{
|
|
|
- [super viewDidLoad];
|
|
|
- [self.checkSavePassword setImage:[UIImage imageNamed:@"unchecked_32.png"] forState:UIControlStateNormal];
|
|
|
- [self.checkSavePassword setImage:[UIImage imageNamed:@"checked_32.png"] forState:UIControlStateSelected];
|
|
|
-
|
|
|
-
|
|
|
- self.editUser.delegate = self;
|
|
|
- self.editPassword.delegate = self;
|
|
|
- self.resize = false;
|
|
|
- self.ioffset = 0;
|
|
|
-
|
|
|
-
|
|
|
- self.title=@"Login";
|
|
|
-
|
|
|
-
|
|
|
- [self.checkSavePassword addTarget:self action:@selector(checkboxClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- // [self.view addSubview:checkSavePassword];
|
|
|
- // Do any additional setup after loading the view, typically from a nib.
|
|
|
-
|
|
|
- self.mum.backgroundColor = [UIColor clearColor];
|
|
|
-
|
|
|
- NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
|
|
|
-
|
|
|
- NSString* shortNum =[infoDict objectForKey:@"CFBundleShortVersionString"];
|
|
|
- NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
|
|
|
- versionNum = [NSString stringWithFormat:@"ver:%@.A%@",shortNum,versionNum];
|
|
|
-
|
|
|
- self.verLabel.text = versionNum;
|
|
|
-}
|
|
|
-
|
|
|
-- (void)viewWillAppear:(BOOL)animated {
|
|
|
- [super viewWillAppear:animated];
|
|
|
-
|
|
|
- NSString * user = RASingleton.sharedInstance.savedUser;
|
|
|
- NSString *password = RASingleton.sharedInstance.savedPassword;
|
|
|
-
|
|
|
- if(user.length>0&&password.length>0)
|
|
|
- {
|
|
|
- self.editUser.text=user;
|
|
|
- self.editPassword.text=password;
|
|
|
- self.checkSavePassword.selected=true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- [self clearNavigationbar];
|
|
|
- [self configureNavigationBar];
|
|
|
-}
|
|
|
-
|
|
|
-- (void)clearNavigationbar {
|
|
|
- self.tabBarController.navigationItem.leftBarButtonItem = nil;
|
|
|
- self.tabBarController.navigationItem.leftBarButtonItems = nil;
|
|
|
- self.tabBarController.navigationItem.titleView = nil;
|
|
|
- self.tabBarController.navigationItem.title = nil;
|
|
|
- self.tabBarController.navigationItem.rightBarButtonItem = nil;
|
|
|
- self.tabBarController.navigationItem.rightBarButtonItems = nil;
|
|
|
-}
|
|
|
-
|
|
|
-- (void)configureNavigationBar {
|
|
|
-
|
|
|
- if (self.navigationController && !self.navigationController.isNavigationBarHidden) {
|
|
|
-
|
|
|
- UIImage *logo = [[UIImage imageNamed:@"apexlogo-2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
|
|
- UIBarButtonItem *logoItem = [[UIBarButtonItem alloc] initWithImage:logo landscapeImagePhone:logo style:UIBarButtonItemStylePlain target:nil action:nil];
|
|
|
- logoItem.enabled = NO;
|
|
|
- self.tabBarController.navigationItem.leftBarButtonItem = logoItem;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-- (void)didReceiveMemoryWarning
|
|
|
-{
|
|
|
- [super didReceiveMemoryWarning];
|
|
|
- // Dispose of any resources that can be recreated.
|
|
|
-}
|
|
|
+#pragma mark - TextFied Delegate
|
|
|
|
|
|
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
|
|
|
|