I have a view controller when a button clicked I'm taking the user to app settings.
UIApplication.openApplicationSettings()
When I come back from appsettings to app then viewwillappear method is not firing.
or is there any other method that will let us know the appsettings is dismissed and user is seeing the screen right now.
You should be using app lifecycle events (SceneDelegate/AppDelegate), not view controller lifecycle events (
viewDidLoad
,viewDidAppear
, etc).sceneDidBecomeActive(_:)
should be fine for your purposes — for iOS 13+, you should be usingSceneDelegate
to listen to scene phases, like going to settings (becoming inactive) and then coming back (becoming active again).If you want to listen to
sceneDidBecomeActive
directly in your view controller, try listening to thedidActivateNotification
notification.