iOS App直接调用SafariController,不跳转到Safari浏览器

原创Blog,转载请注明出处
http://blog.csdn.net/hello_hwc?viewmode=list
我的stackoverflow

profile for Leo on Stack Exchange, a network of free, community-driven Q&A sites


iOS 9 出的新特性,使用起来简单粗暴,对于很多想要展示URL,但是却不想或者没必要自己定制webview(UIWebview或者WKWebview)的时候。

代码
引入

import SafariServices

调用

 let safari = SFSafariViewController(URL: NSURL(string: "http://www.baidu.com")!)
 self.presentViewController(safari, animated: true, completion: nil)

效果
iOS App直接调用SafariController,不跳转到Safari浏览器_第1张图片

你可能感兴趣的:(iOS App直接调用SafariController,不跳转到Safari浏览器)