Skip to content

Instantly share code, notes, and snippets.

@exclusiveTanim
Created November 27, 2018 12:49
Show Gist options
  • Save exclusiveTanim/9d207aae033d42c23278bccb8b915cf9 to your computer and use it in GitHub Desktop.
Save exclusiveTanim/9d207aae033d42c23278bccb8b915cf9 to your computer and use it in GitHub Desktop.
For Login Check Code
-(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