I'm trying to implement a custom back button in a CPInformationTemplate using CPBarButton. It works as expected on iOS 18 — the button appears in the navigation bar and correctly pops the template when tapped.
However, on iOS 16 devices, the custom back button does not respond to taps at all.
The reason I need a custom back button is because I want to perform cleanup and reset logic before popping the template.
Is there any workaround for making this work on iOS 16? Or is there a recommended way to hook into the system back button behavior so that I can execute code when the template is dismissed?
Hi, there was a known issue here in iOS 16. As a workaround, you could observe -[CPInterfaceControllerDelegate templateWillAppear:]
to see when the template before your information template becomes visible, which would happen by way of the user tapping the back button. It should also be called if your app programmatically dismisses the information template.