Skip to content

Instantly share code, notes, and snippets.

@vikdenic
Created June 9, 2016 14:20
Show Gist options
  • Select an option

  • Save vikdenic/d17109476f1920765fc40fa857c1beac to your computer and use it in GitHub Desktop.

Select an option

Save vikdenic/d17109476f1920765fc40fa857c1beac to your computer and use it in GitHub Desktop.
Safari stuff
import SafariServices
extension MainViewController: FlippedViewDelegate, SFSafariViewControllerDelegate {
func didTapTicketsButton(button: UIButton) {
if #available(iOS 9.0, *) {
let svc = SFSafariViewController(URL: NSURL(string: kURLTickets)!)
svc.delegate = self
popup!.dismiss(true)
self.presentViewController(svc, animated: true, completion: nil)
// Fallback on earlier versions
} else {
UIApplication.sharedApplication().openURL(NSURL(string: kURLTickets)!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment