0

I am building an iOS Objective C application and I am wondering if it is possible to force an app to terminate/restart every time the session if backed out of. Is there something I can add to my project to make this functionality possible?

Rob
  • 415,655
  • 72
  • 787
  • 1,044
Roger99
  • 981
  • 2
  • 11
  • 42
  • 1
    If you do it your app will get rejected or removed from App Store. You can however force the user to log out and return to the login screen of your app, if you have some login screen that is.. However, this is not something on topic for SO, you should read: http://stackoverflow.com/help/on-topic For your answer: http://stackoverflow.com/questions/355168/proper-way-to-exit-iphone-application –  Mar 05 '17 at 18:21
  • 5
    There's a `UIApplicationExitsOnSuspend` plist key that you can set so that the app does a fresh launch every time you open it. – dan Mar 05 '17 at 18:25

1 Answers1

-2

One way terminate the app is by using this line of code:

__builtin_trap();

But there's no way to restart an iOS app.

Its worth mentioning though, Apple will reject your app if you use code like this to purposely terminate your app.

Daniel
  • 158
  • 1
  • 14