summaryrefslogtreecommitdiff
path: root/Juick/LoginViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/LoginViewController.m')
-rw-r--r--Juick/LoginViewController.m20
1 files changed, 14 insertions, 6 deletions
diff --git a/Juick/LoginViewController.m b/Juick/LoginViewController.m
index 7a4dbca..366ec96 100644
--- a/Juick/LoginViewController.m
+++ b/Juick/LoginViewController.m
@@ -7,6 +7,7 @@
//
#import "LoginViewController.h"
+#import "User.h"
@implementation LoginViewController
@@ -32,13 +33,20 @@ static NSString *CellIdentifier = @"CellIdentifier";
}
- (void) doneSignIn {
- CATransition* transition = [CATransition animation];
- transition.duration = 0.3;
- transition.type = kCATransitionFade;
- transition.subtype = kCATransitionFromTop;
+ [User checkIsValid:^(BOOL success) {
+ if (success) {
+ CATransition* transition = [CATransition animation];
+ transition.duration = 0.3;
+ transition.type = kCATransitionFade;
+ transition.subtype = kCATransitionFromTop;
+
+ [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
+ [self.navigationController popToRootViewControllerAnimated:NO];
+ } else {
+ [User throwUnableToLogin];
+ }
+ }];
- [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
- [self.navigationController popToRootViewControllerAnimated:NO];
}
-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {