Ich erzeuge Tabellenzelle.Doppeltes Tippen auf Zelle, um modal anzuzeigen VC
cell2 = settingsTableView.dequeueReusableCell(withIdentifier: "ModuleCell", for: indexPath) as! ModuleCell
Es sieht gut aus, hat die Zelle tag = 2000
.
In override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
, ich überprüfe die Tag-Ende if tag == 2000
Ich möchte modale Ansicht präsentieren. Ich mache das auf diese Weise
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let modalView = storyboard.instantiateViewController(withIdentifier: "ModalView")
present(modalView, animated: true, completion: nil)
Dann in ModalView Ich habe eine Schaltfläche, die ModalView entlassen sollte, was passiert wie erwartet.
@IBAction func saveAndClosePopup(_ sender: UIButton) {
UserDefaults.standard.removeObject(forKey: "ActiveCantachoOptions")
UserDefaults.standard.set(Modules.activeCantachoOptions, forKey: "ActiveCantachoOptions")
self.dismiss(animated: true, completion: nil)
}
Wenn ich jedoch sofort wieder vorhanden modalView zu wollen, manchmal ist es in Ordnung, aber manchmal muss ich auf die Zelle zwei Mal getroffen, die modalView zeigen. Nach dem ersten Treffer gibt es keinen Unterschied mehr, wenn ich in 1 Sekunde oder in 30 Sekunden erneut auf die Zelle treffe. Das modalView wird nach dem zweiten angezeigt. Was ist die Ursache?
es wird Ihnen helfen https://stackoverflow.com/questions/22585416/slow-performance-for-presentviewcontroller-depends-on-complexity-of-presenting –
Da du bist überschreiben 'tableView (_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)', rufen Sie die Supermethode auf? – Crazyrems
Haben Sie dem View-Controller überhaupt irgendwelche Tipp-/Long-Touch-Gesten-Erkennungen hinzugefügt? Ich habe gesehen, dass diese die Zellauswahl ein paar Mal stören, bevor – Scriptable