Tim Tim - 1 month ago 13
Swift Question

How to go from settings menu back to app? (Swift IOS 10)

I have created an SMS app in Xcode (Swift). The user will go to the app's settings menu by pressing a button.

Here is the code for the button:

UIApplication.shared.open(NSURL(string: UIApplicationOpenSettingsURLString) as! URL, options:[:], completionHandler: nil)


There I can write the phone number and it will be linked to my app. But when I am in my settings menu I would like to go back to my app. Now it will only go back to the normal settings menu. Is this possible? I have tried looking but it's hard to find something when iOS 10 is new. I have just recently started coding on iPhone apps.

Answer

There's nothing you can do in your own app. The call to open launches another app and leaves your app.

iOS provides two simple ways for the user to return to your app.

  • In the top left corner of the iOS screen will be a little arrow and the name of your app. If the user taps on this, they will be returned to your app.
  • The user can double-tap the Home button to bring up the list of recently used apps. They can then tap on your app's icon to return to your app.