0
我正在網頁查看顯示公司地址,電話號碼和電子郵件。目前的行爲是當電話號碼被竊聽時,然後立即撥打。在Swift的網絡瀏覽器中點擊電話號碼時顯示警告視圖
有沒有辦法讓我提示警報視圖讓用戶確認呼叫?而不是立即調用它?
我正在網頁查看顯示公司地址,電話號碼和電子郵件。目前的行爲是當電話號碼被竊聽時,然後立即撥打。在Swift的網絡瀏覽器中點擊電話號碼時顯示警告視圖
有沒有辦法讓我提示警報視圖讓用戶確認呼叫?而不是立即調用它?
這裏是我用來初始化警報的功能:
func displayAlert(title: String, message: String) {
var alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: { (ACTION) -> Void in
// self.dismissViewControllerAnimated(true, completion: nil)
alert.hidesBottomBarWhenPushed = true
}))
print("running Activityindicator code")
self.presentViewController(alert, animated: true, completion: nil)
}
,我叫它像這樣:
self.displayAlert("Alert title", message: "alert message")
希望這有助於!
我在哪裏可以調用displayAlert()?導致電話號碼在網絡視圖中,而不是按鈕或類似的東西 – Happiehappie