0

I have a project with 2 view controllers, basically as Weather app or Stocks. App uses storyboard and switching between views with segues. 1-st view is "main", 2-nd is in-app settings.

So I go to "settings" and then press home button.

I need when I launch app next time to be in main view, not in settings. How do I switch from 2-nd vc to 1-st after app goes to background (when home button is pressed)?

Do I need to use "performSegueWithIdentifier:" somewhere? Can I execute it from app delegate?

artysx
  • 533
  • 5
  • 14

1 Answers1

0

Make the switch in your AppDelegate's applicationWillResignActive. This is called a moment before your app becomes inactive.

Stavash
  • 14,244
  • 5
  • 52
  • 80