From 2ddd7f7964d09236b43485c795970038dd1c309f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 21 Mar 2019 13:48:40 +0300 Subject: New login API --- Juick/Model/User.h | 2 +- Juick/Model/User.m | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Juick/Model') diff --git a/Juick/Model/User.h b/Juick/Model/User.h index 92a6333..6265687 100644 --- a/Juick/Model/User.h +++ b/Juick/Model/User.h @@ -17,6 +17,6 @@ + (BOOL) isAuthenticated; -+ (void) throwUnableToLogin:(UIViewController *)view; ++ (void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error; @end diff --git a/Juick/Model/User.m b/Juick/Model/User.m index 6d5e818..344eb7b 100644 --- a/Juick/Model/User.m +++ b/Juick/Model/User.m @@ -24,10 +24,10 @@ return password != nil; } -+(void) throwUnableToLogin:(UIViewController *)view { ++(void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error { UIAlertController *alert = [UIAlertController new]; - [alert setTitle:@"Error"]; - [alert setMessage:@"Unable to login, check username/password, or network connectivity"]; + [alert setTitle:@"Something went wrong"]; + [alert setMessage:error.localizedDescription]; [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]]; UIPopoverPresentationController *popover = [alert popoverPresentationController]; if (popover) { -- cgit v1.2.3