youtube opening in safari instead of UIWebView
I am using below code.
NSURL *instagramURL = [NSURL
URLWithString:@"http://www.youtube.com/watch?v=H9VdapQyWfg"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
} else {
WebViewViewController *secondView = [self.storyboard
instantiateViewControllerWithIdentifier:@"webinterface"];
secondView.headerLabel = @"You Tube";
secondView.webPath = @"http://www.youtube.com/watch?v=H9VdapQyWfg";
[self.navigationController pushViewController:secondView animated:YES];
}
Right now I don't have YouTube app in my iPhone. So what I was expecting
is the URL will open in UIWebView (WebViewViewController) i.e. else
condition will work.
However it is opening video in safari.
Any idea why this is happening?
No comments:
Post a Comment