每当在模拟手机中显示UIAlertController操作表时,都会收到此警告。该代码没什么花哨的。
let action1 = UIAlertAction(title: "Action 1", style: .default) { _ in }
let action2 = UIAlertAction(title: "Action 2", style: .default) { _ in }
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let alert = UIAlertController(title: "title", message: "message", preferredStyle: .actionSheet)
alert.addAction(action1)
alert.addAction(action2)
alert.addAction(cancel)
self.present(alert, animated: true)
Run Code Online (Sandbox Code Playgroud)
我正在运行Xcode 10.2(10E125),Swift5。该约束似乎超出了我的控制范围,但是请告知我是否做错了。
