0


I'm currently working with multi storyboard project for avoid storyboard conflict.
I'm using XCode 8.2.1 and it's very easy if I use Storyboard Reference. But when I change deployment target to 8.0 it's say "Storyboard Reference does not work on ios 8" and now I wanna change my storyboard structure for sure the project will working with ios lower than 9.
How can I do that? Can someone give me a guide for do it?
For more detail, this picture below is my setup of Main.storyboard.
Thank in advance. enter image description here

Update: I have tried to search and found this question but it doesn't help me to solve my problem. That why I'm create a new here for looking a help.

Community
  • 1
  • 1
Bad_Developer
  • 537
  • 5
  • 20
  • Possible duplicate of [Storyboard reference in Xcode, where should we use it?](http://stackoverflow.com/questions/30772145/storyboard-reference-in-xcode-where-should-we-use-it) – OMGHaveFun Mar 25 '17 at 10:07
  • @OMGHaveFun I don't think show, your reference link is asked how to use storyboard reference. And my problem is how to push from `UITabBarController` without using `Storyboard Reference`. But also thank you for the remind. – Bad_Developer Mar 25 '17 at 12:08

1 Answers1

0

Easy.

First off, remove your Storyboard Reference from your Main.storyboard Then load your storyboards programmatically when needed.

For example, remove your loginVC reference. Then use the following code to load the storyboard and loginVC when needed.

Swift 3

let storyboard = UIStoryboard(name: "YourStoruboardName", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "YourVC_Identifire")
self.navigationController!.pushViewController(vc, animated: true)

Don't forget to set Storyboard ID

NOTE: Before iOS 9, it wasn't possible to load other screens from others storyboard graphically(via reference). So you need to load your other screen from others storyboard via code.

Partho Biswas
  • 2,290
  • 1
  • 24
  • 39
  • The loginVC is not problem. But I'm using UITabBarController for navigate to other screen from others storyboard. Like chatVC, homeVC, ticketVC... I mean how can I navigate to them from UITabBarController if they does not in same `Main.storybard` without using Storyboard Reference? – Bad_Developer Mar 25 '17 at 11:46
  • If you want your app to be compatible lower than iOS 9, you must remove `Storyboard Reference`. So on the above answer, I told you an other way to do so. Instead of Storyboard Reference. – Partho Biswas Mar 25 '17 at 11:49
  • Before iOS 9, it wasn't possible to load other screens from others storyboard graphically(via reference). So you need to load your other screen from others storyboard via code. And you can use above code to do that. – Partho Biswas Mar 25 '17 at 11:58
  • That was what I mean, I think this code above only use if I want to show other view controller? Now all I need to do is handle whenever an item on UITabBarController clicked with `tabBarController:didSelectViewController:` and use above code for pushing? Right? – Bad_Developer Mar 25 '17 at 12:05
  • Yes. And when you load any `Viewcontroller` from any `Storyboard`, then you can use/call any graphical segue attached with that `ViewController`. – Partho Biswas Mar 25 '17 at 12:16
  • Let me try it again. Thanks for you help – Bad_Developer Mar 25 '17 at 12:17