テーブルセルをタップした後、警告表示が表示されるまでに4〜5秒の遅延があります。コードは次のとおりですUIAlertControllerからdelayを削除するには?
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
let cell = tableView.cellForRow(at: indexPath)!
let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .alert)
let ok = UIAlertAction(title: "Ok", style: .default, handler: { (action) -> Void in
let cell = tableView.cellForRow(at: indexPath)!
})
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: { (action) -> Void in
})
alertController.addAction(ok)
alertController.addAction(cancel)
present(alertController, animated: true, completion: nil)
}
この遅延を回避するにはどうすればよいですか?
アニメーションは遅く見えますか? –
いいえ、表示する必要のあるアクションメソッド、つまり「OK」、アラートコントローラの「キャンセル」です。 – leaner122
あなたはどこのバックグラウンドスレッドですか? – Rikh