Posted at

【Swift3】アプリから電話をかける方法

More than 1 year has passed since last update.

let url = NSURL(string: "tel://09012345678")!

if #available(iOS 10.0, *) {
UIApplication.shared.open(url as URL)
} else {
UIApplication.shared.openURL(url as URL)
}

※シミュレーターでは反応しません。

【参考】

nsurl - How to use openURL for making a phone call in Swift? - Stack Overflow

ios - how to open an URL in Swift3 - Stack Overflow