/sidebar-ios14

Example of how to use the new iOS 14 sidebar UI element.

Primary LanguageSwiftOtherNOASSERTION

Sidebar iOS 14

This is a sample project demonstrating how to implement the new Sidebar UI on an iPad app using Swift. It tries to mimic the UI of the new Music app on iPadOS 14.0:

Preview.png

It contains just the code required to create the UI, and it was based on the Apple's sample project Implementing Modern Collection Views.

TO-DO

  • Maintain the selection when contracting/expanding a section.
  • Restore the state of a view controller when changing between regular and compact mode.
  • Revert to tab bar based navigation on compact layouts, and on the iPhone.

Known bugs

Starting the app in compact mode, and then changing it to regular mode causes the following error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected view controller change in Secondary column for expanding <UISplitViewController: 0x10550a630>'

I have a question for this on the Apple Developer Forums, I'm not sure if this is a bug in the API, or if I'm using it incorrectly.

Documentation links

WWDC20 videos