|
@@ -52,8 +52,6 @@ class ContactDetailViewController: UITableViewController {
|
|
|
return cell
|
|
|
}()
|
|
|
|
|
|
-
|
|
|
-
|
|
|
init(contactId: Int) {
|
|
|
self.contactId = contactId
|
|
|
super.init(style: .grouped)
|
|
@@ -63,6 +61,17 @@ class ContactDetailViewController: UITableViewController {
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
}
|
|
|
|
|
|
+ override func viewDidLoad() {
|
|
|
+ super.viewDidLoad()
|
|
|
+ navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Edit", style: .plain, target: self, action: #selector(editButtonPressed))
|
|
|
+ self.title = "Contact"
|
|
|
+ }
|
|
|
+
|
|
|
+ override func viewWillAppear(_ animated: Bool) {
|
|
|
+ super.viewWillAppear(animated)
|
|
|
+ tableView.reloadData()
|
|
|
+ }
|
|
|
+
|
|
|
override func numberOfSections(in tableView: UITableView) -> Int {
|
|
|
return 2
|
|
|
}
|
|
@@ -147,6 +156,10 @@ class ContactDetailViewController: UITableViewController {
|
|
|
present(notificationSetupAlert, animated: true, completion: nil)
|
|
|
}
|
|
|
|
|
|
+ @objc private func editButtonPressed() {
|
|
|
+ coordinator?.showEditContact(contactId: contactId)
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|