Created
April 5, 2018 06:02
-
-
Save 328/cc4b59f233e80aa54bc679632a50a333 to your computer and use it in GitHub Desktop.
Safariへのリダイレクト
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
import UIKit | |
class ViewController: UIViewController , UIWebViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// URLを指定 | |
let url = URL(string: "http://localhost:8080/refrects")! | |
if #available(iOS 10.0, *) { | |
UIApplication.shared.open(url, options: [:], completionHandler: nil) | |
} else { | |
UIApplication.shared.openURL(url) | |
} | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment