Hi! I`m just playing around with updating (revamping) one of my old apps on the store that uses Story Teller Kit 2 for iOS11 and decided that I would like to try to implement ARKit SceneKit into it as well.
I know how to set up the new ViewController in the Main.storyboard and link them by standard Segues (I have the original GameViewController and I`ve created a new ARGameViewController linked to the new ARGameViewConntroller.swift file). But the problem is, how can I switch between different view controllers by using a button on the actual pages (like “Cover.sks”)?
The Segue buttons on the GameViewController get hidden in the background when the app loads so the viewer cannot access them to switch, plus I only want this option available on certain main pages.
I plan to have the story side of the App as well as the ARGame side so that when the app loads, there will be a button on each of the main pages. “Cover.sks, CoveriPhone.sks” etc. that will allow the player to switch over to the ARgame. I would also need a button to switch back from, the ARGameViewController to the GameViewController.
There`s no option to do this via the current .plist file, so I think a hard-coded button on each page would probably be necessary correct?
Ive been searching StackOverflow, but using a button from a .sks file to call/load a new ViewController in Main.storyboard seems to be a bit of a challenge and I havent found a way to do it other than the standard segues, which I already know how to do.
Could you please provide an example or let me know if this is possible?
I think you’d just want to integrate the AR code into the existing ViewController. That way you aren’t switched out view controllers, you are just switching scenes. Usually when I make an SKScene go up the chain of command and tell the ViewController to do something, I post an NSNotification.
See where that gets you. Its an interesting question for sure.