In my viewDidLoad
, I add code to follow UIApplication.didBecomeActive
notification as follows:
NotificationCenter.default.addObserver(self,
selector: #selector(ViewController.applicationDidBecomeActive),
name: UIApplication.didBecomeActiveNotification,
object: UIApplication.shared)
The question is whether it is a given that once the notification is subscribed in viewDidLoad
, the notification callback will not fire before viewDidLayoutSubviews()
is called? It so happens on all my iOS devices across all iOS versions but it seems to be the source of bug if this is not true. Trying to figure out sources of all unreproducible bugs, not sure if this can be one of them.