0

I'm new to iOS. I have a storyboard with a navigation controller as initial view controller:

enter image description here

And I need some splash screen as a first screen after Launch screen to determine if user has a subscription or not. Depending on the result, I want to get to navigation view controller which is now initial view controller or to subscription screen (which is now the third in the tree).

In the second case, I want to save the existing structure where the navigation controller remains at the top

I found a couple of manuals, but they did not work in my case. How to do it properly?

Dima
  • 1,189
  • 1
  • 8
  • 12
  • 1
    "did not work" is a bit unspecific. I think there are two ways. *1)* You can have another view controller with a segue to the navigation controller, which is only performed in case the user has a subscription. *2)* You start with the navigation controller, and in the navigation controller's `viewDidLoad()` function you check for the subscription. In case the user does not have a subscription, you just push the view controller on top of the view hierarchy modally. – Victor Pro May 02 '20 at 11:29
  • @VictorPro. Thank you, I'll try – Dima May 02 '20 at 15:30

1 Answers1

1

tell me if i have not indersttod well. @Victor Pro his solution inspired me.

//1. You need a like SplashScreenVC after launch screen. so in storyboard you can set it as a initial view controller.

//2. After determining in any case Preset a Initial Navigation Controller which is your main controller. subscriptionNeeded = true , if subcription needed

///3. If your subscription needed then take one flag in appdelegate/global variable that subscriptionNeeded , and set it true.

///3.1 when you do point 2, in that in navigation controller -> root view controller -> View Will Appear

if subscriptionNeeded {
     subscriptionNeeded = false
    Push / Preset a sunscription VC
}

Tell me if i am not getting. Or u not get what i wrote.

Arpit B Parekh
  • 1,932
  • 5
  • 36
  • 57