Skip to content

Instantly share code, notes, and snippets.

@erikfloresq
Created March 4, 2016 22:16
Show Gist options
  • Save erikfloresq/4ce14379cac9428e1075 to your computer and use it in GitHub Desktop.
Save erikfloresq/4ce14379cac9428e1075 to your computer and use it in GitHub Desktop.
show safariViewController
class func showSafariWebWith(urlString:String,inView view:UIViewController){
let url = NSURL(string: urlString as String)
if #available(iOS 9.0, *) {
//let safariVC = SFSafariViewController(URL: url!)
let safariVC = SFSafariViewController(URL: url!, entersReaderIfAvailable: true)
safariVC.view.tintColor = UIColor(red: 189/255.0, green: 151/255.0, blue: 8/255, alpha: 1)
view.presentViewController(safariVC, animated: true, completion: nil)
} else {
// Fallback on earlier versions
UIApplication.sharedApplication().openURL(url!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment