ios - Change to Different View Controller Immediately after authenticating in a Web View -
i have uiwebview opens webpage in app user can log in account. want app change view controllers after user has logged account without seeing next webpage in webview. code in viewdidload
function:
- (void)viewdidload { [super viewdidload]; nsstring *webpage = @"myfakewebpage.com"; self.defaults = [nsuserdefaults standarduserdefaults]; [self.activityindicator startanimating]; [self.mywebview sethidden:yes]; self.mywebview.delegate = self; nsurl *myurl = [nsurl urlwithstring:triggerpage]; self.myrequest = [nsurlrequest requestwithurl:myurl]; [self.mywebview loadrequest:self.myrequest]; }
and webviewdidfinishload
function looks like:
- (void)webviewdidfinishload:(uiwebview *)webview { if ([self.activityindicator isanimating] == yes) { [self.activityindicator stopanimating]; [self.activityindicator sethidden:yes]; [self.mywebview sethidden:no]; } [self loadviewcontrollerafterauthentication]; }
[self loadviewcontrollerafterauthentication];
calls function built myself change view controller through poor workaround based on response of webpage after user has authenticated. of right now, user can authenticate, next webpage load half second before code kicks in , new view controller displayed. if has idea on how can make transition described above smoother, appreciated.
Comments
Post a Comment