On iOS 14, the sidebar in the Calendar app appears to be the primary controller of a split view controller of style UISplitViewControllerStyleDoubleColumn.
The state of the Calendar sidebar is controlled by three bar button items: the Calendars button, the Inbox button, and the Today button.
When the sidebar is visible, these buttons appear in the navigation bar of the sidebar. When the sidebar is closed, the three buttons animate to the secondary controller's navigation bar.
How do you specify the buttons such that they animate on show/hide?
Steve
The state of the Calendar sidebar is controlled by three bar button items: the Calendars button, the Inbox button, and the Today button.
When the sidebar is visible, these buttons appear in the navigation bar of the sidebar. When the sidebar is closed, the three buttons animate to the secondary controller's navigation bar.
How do you specify the buttons such that they animate on show/hide?
Steve
Calendar provides their own UI and control of the UISplitViewControllers that they use—all with API (at least the UISVC behavior is all API), though the wrapped internal UISVC is definitely pushing the envelope.
In order to have sidebars on both sides they have a wrapped UISVC with primaryEdge = trailing in the secondary column of their main UISVC. (This is the delicate thing that they do, and you might run into trouble that we can't help you with).
Then, they have presentsWithGesture = NO on both UISVC's. This suppresses the default displayModeButtonItem. (-initWithStyle: UISVC takes much more control over the button item than before.) They don't want gesture-driven sidebar behavior, but if they did they would have had to add their own gestures.
I forget what navigation controller is providing their navigation bar (or bars), but they put their own bar button items in there, with their own actions, which ultimately call -showColumn:/hideColumn: as they want.
For coordinating animations, immediately after sending -show/hideColumn: you can request the UISVC's transitionCoordinator and use the alongside API to coordinate animations or completions with the UISVC's show/hide animation.
In order to have sidebars on both sides they have a wrapped UISVC with primaryEdge = trailing in the secondary column of their main UISVC. (This is the delicate thing that they do, and you might run into trouble that we can't help you with).
Then, they have presentsWithGesture = NO on both UISVC's. This suppresses the default displayModeButtonItem. (-initWithStyle: UISVC takes much more control over the button item than before.) They don't want gesture-driven sidebar behavior, but if they did they would have had to add their own gestures.
I forget what navigation controller is providing their navigation bar (or bars), but they put their own bar button items in there, with their own actions, which ultimately call -showColumn:/hideColumn: as they want.
For coordinating animations, immediately after sending -show/hideColumn: you can request the UISVC's transitionCoordinator and use the alongside API to coordinate animations or completions with the UISVC's show/hide animation.