/// 拨打电话
/// - Parameter phoneNum: 电话号码
func callDialPhone(_ phoneNum: String) {
// 格式化电话号码(有空格无法唤起打电话弹窗)
let phoneNums = phoneNum.replacingOccurrences(of: " ", with: "")
let phoneUrl = "telprompt://\(phoneNum)"
if let url = URL(string: phoneUrl), UIApplication.shared.canOpenURL(url){
if #available(iOS 10, *) {
UIApplication.shared.open(url)
} else {
UIApplication.shared.openURL(url)
}
} else {
print("无法打电话")
}
}
callDialPhone("10086")