Fix a bug caused by initializing editUIBarButtonItem with self in action
Change to lazy initialization variable can fix it.
This commit is contained in:
parent
7a31c4db06
commit
6d7bf62cf7
1 changed files with 5 additions and 1 deletions
|
|
@ -35,7 +35,10 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
|||
return indicator
|
||||
}()
|
||||
|
||||
let editUIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: #selector(pressEdit(_:)))
|
||||
lazy var editUIBarButtonItem: UIBarButtonItem = {
|
||||
let uiBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: #selector(pressEdit(_:)))
|
||||
return uiBarButtonItem
|
||||
}()
|
||||
|
||||
|
||||
struct TableCell {
|
||||
|
|
@ -146,6 +149,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
|||
}
|
||||
|
||||
func pressEdit(_ sender: Any?) {
|
||||
print("pressEdit")
|
||||
performSegue(withIdentifier: "editPasswordSegue", sender: self)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue