You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, we can subscribe with KVO to the key window, its root view controller and if we want to, to changes in any navigation/page controller in the hierarchy.
The text was updated successfully, but these errors were encountered:
More information on this, UIKit is not KVO compliant and if you find something that is, you might find that it won't in the future so that's the end of the road.
There is a UIWindowDidBecomeKeyNotification notification that is sent when the key window changes, from that we can store the window and ask from time to time the current view controller by traversing the VC hierarchy. It's not very reliable but it's the best we can do.
Apart from that, UIPageViewControllers don't always hold the current page in a public property so information might be just wrong and we can only do a guess by reading its viewControllers array property.
Theoretically, we should be able to get the current view controller being presented by calling something like:
Additionally, we can subscribe with KVO to the key window, its root view controller and if we want to, to changes in any navigation/page controller in the hierarchy.
The text was updated successfully, but these errors were encountered: