Created
September 25, 2013 19:38
-
-
Save joelmgallant/6704918 to your computer and use it in GitHub Desktop.
This file contains 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
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error | |
{ | |
NSLog(@"Webview load failed with error: %@", error); | |
if(error.code == NSURLErrorCancelled) | |
{ | |
// [webView reload]; | |
} | |
{ | |
// fake like I've returned! | |
// Orient to Portrait & size to default... | |
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationPortrait; | |
CGRect screenRect = [[UIScreen mainScreen] bounds]; | |
CGFloat screenWidth = screenRect.size.width; | |
CGFloat screenHeight = screenRect.size.height; | |
[_webview setTransform:CGAffineTransformFromUIOrientation(UIInterfaceOrientationPortrait)]; | |
[_webview setCenter:CGPointMake(screenWidth/2, screenHeight/2)]; | |
_webview.frame = self.view.bounds; | |
//Notify unity loading completed | |
UnitySendMessage("WebViewLoginMediator", "LoadComplete", "true"); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment