Search code examples
iosswiftpermissionscamera

UIViewController dismiss after camera permission updated in Settings


im redirecting the user to Settings if camera access isn't allowed and user profile page dismiss when the camera permission changed.

UIViewController dismiss after camera permission updated in Settings

  1. On tap Go to Settings option to change permission settings
  2. After Camera permission value change
  3. When on tap previous app button(?) on status bar
  4. Current UIViewController dismiss and it goes to previous UIViewController which is rootViewController

How to prevent this situation?


Solution

  • Look at that answer: Having app restart itself when it detects change to privacy settings

    The app restarts and you can't prevent this. You can preserve and restore the state: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/PreservingandRestoringState.html