0
我正在使用以下代碼執行電話呼叫。Swift /電話/檢查用戶是否想撥打電話
@IBAction func phoneButtonAction(sender: AnyObject) {
let phone = "tel://123456789"
let url:NSURL = NSURL(string:phone)!
UIApplication.sharedApplication().openURL(url)
}
此函數即時調用所需的數字。 詢問用戶是否確定他想打電話的最佳做法是什麼。
幫助非常感謝。
呈現'UIAlertController',詢問是否要打電話或不 – dan
,我如何問「addButtonWithTitle」已被點擊了什麼? –
'UIAlertController'沒有'addButtonWithTitle:',那就是'UIAlertView',這是棄用的,你不應該使用。 – dan