Created
November 27, 2018 12:49
-
-
Save exclusiveTanim/9d207aae033d42c23278bccb8b915cf9 to your computer and use it in GitHub Desktop.
For Login Check Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(IBAction)logincheck:(id)sender{ | |
if ([_Text1.text isEqualToString:@""] || [_Text2.text isEqualToString:@""]) { | |
UIAlertController *error1 = [UIAlertController alertControllerWithTitle:@"Alert Message" message:@"Enter User Name and Password" preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]; | |
[error1 addAction:cancel]; | |
[self presentViewController:error1 animated:YES completion:nil]; | |
} | |
else if ([_Text1.text isEqualToString:@"admin"] || [_Text2.text isEqualToString:@"12345"]){ | |
MainViewController *HomePage = [self.storyboard instantiateViewControllerWithIdentifier:@"mainView"]; | |
[self.navigationController pushViewController:HomePage animated:YES]; | |
} | |
else{ | |
UIAlertController *error1 = [UIAlertController alertControllerWithTitle:@"Alert Message" message:@"You have used wrong User Name and Password" preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]; | |
[error1 addAction:cancel]; | |
[self presentViewController:error1 animated:YES completion:nil]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment