Created
March 4, 2016 22:16
-
-
Save erikfloresq/4ce14379cac9428e1075 to your computer and use it in GitHub Desktop.
show safariViewController
This file contains hidden or 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
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