Why does viewWillAppear not get called when an app comes back from the background?

Swift Short answer Use a NotificationCenter observer rather than viewWillAppear. override func viewDidLoad() { super.viewDidLoad() // set observer for UIApplication.willEnterForegroundNotification NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil) } // my selector that was defined above @objc func willEnterForeground() { // do stuff } Long answer To find out when an app comes back from the … Read more