SFSafariViewController
- 父类是UINavigationController
- IOS9新出用于网页展示,使用Safari打开网页,功能由苹果实现
SFSafariViewController使用
// 创建
SFSafariViewController *sarariVc = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:urlStr]];
// 获取tabBarController
UITabBarController *tabBarVc = (UITabBarController *)KEYWINDOW.rootViewController;
// 实现跳转
[tabBarVc presentViewController:sarariVc animated:YES completion:nil];
网页打开方式
- 方式一:通过SFSafariViewController
- 方式二:通过UIWebView
- 方式三:通过UIApplication的openURL方法