But how does it know I'm trying to implement the delegate for ARSKViewDelegate when I use class GameViewController < UIViewController
After some trial and error I got it to work. I missed setting the .delegate = self. However that resultet in my viewWillAppear only firering once (even if i kill app and restart).
To solve this i had to do something like this
From Slack:
NSLog("RM_AR_DEBUG viewDidLoad")
self.view = arsk_view @scene_view = arsk_view @scene_view.delegate = self
@game_scene = GameScene.sceneWithSize(arsk_view.size) @game_scene.scaleMode = SKSceneScaleModeAspectFit
arsk_view.presentScene(@game_scene)
arsk_view.showsFPS = true arsk_view.showsNodeCount = true end
def arsk_view @arsk_view ||= ARSKView.alloc.initWithFrame(screen_rect) end
def viewWillAppear(animated) super(animated)
NSLog("RM_AR_DEBUG viewWillAppear")
configuration = ARWorldTrackingConfiguration.new @scene_view.session.runWithConfiguration(configuration) end