I am using the Coordinator Pattern to manage the overall app architecture as outlined in the tutorial project for Chapter 23.
The App Coordinator
has a Splash View Controller
that mimics the Launch Screen
to be displayed while it determines which child coordinator to present, Onboarding Coordinator
or Home Coordinator
respectively.
If the user launches the app normally (without any Launch Options
), the App Coordinator
will use its normal logic to determine which child coordinator to present. If the user launches the app with a Launch Option, such as a URL they’ve clicked, that takes precedence and is passed to the App Coordinator
which uses it to determine which child coordinator to present and passes it down the stack.
That seems easy enough – my problem occurs when the app is already running and the App Coordinator
is presenting either two of the child coordinators, but the user re-opens the app through a URL and the App Delegate
receives the application: openURL: options
call.
What is the cleanest way to handle this such that this information is passed to the App Coordinator
which then uses it to present the correct screen of the correct child coordinator, but with the option to return to wherever the user was at before?