Post

Replies

Boosts

Views

Activity

UISplitViewController Column Style and Compact Mode
Hey, I'm trying to get a handle of the new column style split view controllers. I find the documentation and related WWDC videos a little lacking when it comes to the details. Pushing a detail view controller When using showDetailViewController in compact mode everything works fine the first time. But if the user goes back to the root and taps another item to push a show a new detail the previous detail view appears between the new detail and the root. Ie. I have to tap back twice to get back to the root because the first detail view shows on the first back tap. So to fix this I need to become a navigation controller delegate, listen for pops and make sure I clean up the detail view controller's navigation controller to remove all of it's children. Because apparently pushing a detail view actually pushes the detail wrapped in a second navigation controller. I assume this is some implementation detail to make it work in column mode. This seems like a bug and a hacky fix. Transitioning to Compact mode Another work around is to use a compact mode view hierarchy even if it's not strictly necessary to provide another navigation method for compact modes. Now the question becomes how to keep these in sync? It seems like the split view delegate methods allow me to modify the compact controller to configure it to the right view. But attempting to modify the various split view columns when going the other way is not allowed for some reason. Which makes it seem like the only way to keep the regular width columns in sync with the compact mode is to do that "all the time". Which means an app in slide-over mode on an iPad would have to somewhat identical view controller hierarchies running simultaneously. Am I holding it wrong? I feel like I'm missing something. Or perhaps the APIs aren't 100% fully baked and this is what we have to deal with in this first iteration of the new column style? Which is fine. But I wish it was better described how I'm supposed to handle these scenarios.
0
0
648
Jan ’21