Bring previous app back to the front when user is done with my iOS app

前端 未结 2 1017
遇见更好的自我
遇见更好的自我 2020-12-11 22:18

My iOS 4/5/6 app is meant to be used briefly. I want the user to click a \"Done, now go away\" button which takes them back to the app they were using before mine came to th

2条回答
  •  不知归路
    2020-12-11 22:57

    I want the user to click a "Done, now go away" button

    That button is the Home button.

    I want to programmatically return the previous app to the front.

    There's no public API for switching to another app. Users have a number of options for switching between apps, though. In addition to the swipe gesture you mentioned, they can do a four-finger upward swipe to get to the list of recent apps, or double-tap the home button for the same effect, or hit the home button once to go back to Springboard. Users, not apps, are supposed to be in control of which app is in the foreground. And the way they do that should be standard from one app to another. I can understand wanting to make life easier for the user, but what you're trying to do just isn't possible with the available API.

提交回复
热议问题