請參閱鏈接UIAlertController - add custom views to actionsheet 我的UI佈局。取消按鈕在自定義操作表中不可點擊
我在我的應用程序中具有相同的自定義操作表佈局。代碼以相同的方式寫入。我注意到,在swift4中,「取消」按鈕不會執行任何操作。當我在挖掘代碼「取消」按鈕下方
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: {(alert: UIAlertAction!) in
print("Cancel")
})
代碼:print(Cancel")
不執行。
它不打印取消? –
它可以完美地適用於我 –
您是否將此操作添加到控制器? –