Show list edit screen immediately upon creation
This commit is contained in:
parent
ae6a0513e4
commit
f92a2acc97
|
@ -173,7 +173,9 @@ class ExploreViewController: EnhancedTableViewController {
|
|||
self.reloadLists()
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.show(ListTimelineViewController(for: list), sender: nil)
|
||||
let listTimelineController = ListTimelineViewController(for: list)
|
||||
listTimelineController.presentEditOnAppear = true
|
||||
self.show(listTimelineController, sender: nil)
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
|
|
@ -13,6 +13,8 @@ class ListTimelineViewController: TimelineTableViewController {
|
|||
|
||||
let list: List
|
||||
|
||||
var presentEditOnAppear = false
|
||||
|
||||
init(for list: List) {
|
||||
self.list = list
|
||||
|
||||
|
@ -31,13 +33,25 @@ class ListTimelineViewController: TimelineTableViewController {
|
|||
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: #selector(editButtonPressed))
|
||||
}
|
||||
|
||||
// MARK: - Interaction
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
@objc func editButtonPressed() {
|
||||
if presentEditOnAppear {
|
||||
presentEdit(animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
func presentEdit(animated: Bool) {
|
||||
let editListAccountsController = EditListAccountsViewController(list: list)
|
||||
editListAccountsController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonPressed))
|
||||
let navController = UINavigationController(rootViewController: editListAccountsController)
|
||||
present(navController, animated: true)
|
||||
present(navController, animated: animated)
|
||||
}
|
||||
|
||||
// MARK: - Interaction
|
||||
|
||||
@objc func editButtonPressed() {
|
||||
presentEdit(animated: true)
|
||||
}
|
||||
|
||||
@objc func doneButtonPressed() {
|
||||
|
|
Loading…
Reference in New Issue