-1

This might be a little confusing, but I am trying to keep my iOS app on a certain view until the user exits out of it. Problem is that view isn't the initial VC, so when it clears from RAM all data entered is lost. Is there a way to maintain that view in memory for the as long as I'd like? I've considered using CoreData, but that would only save that data, and I want to maintain the session that certain view.

ShedSports
  • 541
  • 2
  • 7
  • 14

1 Answers1

0

You can't store the VC, but you can store where you want to go (e.g. with UserDefaults) and use AppDelegate/SceneDelegate to present the VC programatically (it doesn't matter if it is set as initial VC in the storyboard or not). To do this, follow the steps you can find e.g. here (AppDelegate) or here (SceneDelegate)

Michael
  • 657
  • 5
  • 22
  • This is now outdated if you are using iOS13.x as you will now need to present the initial VC from SceneDelegate. – flanker Mar 05 '20 at 23:52