[英]Unable to cancel a dial pad in phone number
I think so This question is not duplicate one. 我认为是这样,这个问题不是重复的。 Call to phone number when touching cancel Action my app throws app to initial screen instead of displaying current screen.
触摸“取消”操作时拨打电话号码我的应用程序将应用程序引发到初始屏幕,而不是显示当前屏幕。 Is this a bug in iOS11 or is there something that I am doing wrong from following code.
这是iOS11中的错误,还是我遵循以下代码做错了什么? this is my code.
这是我的代码。
@objc func CallAction(_ sender : UIButton)
{
var localDic :NSDictionary!
if is_searching {
localDic = searchingDataArray.object(at: sender.tag) as! NSDictionary
}else
{
localDic = myStudentsArray.object(at: sender.tag) as! NSDictionary
}
let phoneNumber=localDic["contact_no"] as! String
print("phoneNumber",phoneNumber )
guard let number = URL(string: "tel://" + phoneNumber) else { return }
UIApplication.shared.open(number)
}
Use the following code 使用以下代码
guard let telNumber = URL(string: "telprompt://" + "+1234-567-89") else { return }
if #available(iOS 10.0, *) {
UIApplication.shared.open(telNumber)
} else {
// Fallback on earlier versions
}
hope its works.. 希望它的作品..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.