The O.G. Virtual learning! Buy one, get 2 more Lifetime Memberships! - Click Here!

Navigating to an ARKit SpriteKit View from Cover.sks

Home 4 Forums iOS / tvOS Starter Kits The Story Tellers Kit 2 for iOS or tvOS Apps Navigating to an ARKit SpriteKit View from Cover.sks

This topic contains 2 replies, has 2 voices, and was last updated by  Walter Ragland 3 years, 7 months ago.

  • February 7, 2018 at 2:56 am #179946

    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?


  • February 7, 2018 at 10:06 am #179955

    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.

    • February 10, 2018 at 7:45 am #180071

      Thanks as always! I was going for something a little different, but I see what you mean. 🙂

You must be logged in to reply to this topic.

Know what an affiliate program is? You make money just by sharing links to our site! Win. Win.

Earn when you refer any buyer here! 30 day tracking. Commissions are 33%-50% and recur on subscription products!

Uh oh, missing your affiliate ID. Create one real quick