Fix detail replacement in compact mode
Do not push created profile onto presented profile or any other screen deeper inside (e.g. Parameters).
This commit is contained in:
parent
06ecd3367f
commit
3d62728a95
|
@ -451,6 +451,20 @@ extension OrganizerViewController {
|
|||
reloadModel()
|
||||
tableView.reloadData()
|
||||
|
||||
// XXX: hack around bad replace when detail presented in compact view
|
||||
if let detailNav = navigationController?.viewControllers.last as? UINavigationController {
|
||||
var existingServiceVC: ServiceViewController?
|
||||
for vc in detailNav.viewControllers {
|
||||
if let found = vc as? ServiceViewController {
|
||||
existingServiceVC = found
|
||||
break
|
||||
}
|
||||
}
|
||||
let serviceVC = existingServiceVC ?? (StoryboardScene.Main.serviceIdentifier.instantiate().topViewController as! ServiceViewController)
|
||||
serviceVC.profile = profile
|
||||
detailNav.setViewControllers([serviceVC], animated: true)
|
||||
return
|
||||
}
|
||||
perform(segue: StoryboardSegue.Organizer.selectProfileSegueIdentifier, sender: profile)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue