I am working on a simple SpriteKit App which has a sprite based game which I would like to superimpose on a complex UIImageView ( > 100 subviews) and which I will need to access during game play (ie change alpha of subviews and other animations) I have tried to get this effect a number of ways but none work. First I tried to make the background a Node filled with substrates, but the subsprites do not position correctly. The most promising approach so far is to combine the views of the main ViewController and the Scene:
√ 1) Desired background UIImageView ("bg") is placed in view of main ViewController and draw into it
√ 2) Create a Protocol with delegate methods that can be called from the game's GameScene.swift
√ 3) Create Scene in main VC in the usual way. Set the scene background color to .Clear
√ 4) in GameScene.swift set up the reference to the protocol delegate
√ 5) prove I have access to the bg image from didMove(to view: SKView) by changing alpha or background color. Delegate access from didBegin(contact) also works
The problem is: that my bg imageView is drawn IN FRONT OF my game scene and I can not figure out how to change the draw order.
The game scene is not in the subviews array of the mainVC, and the bg image view is not in the subViews of the game scene view.
Without common references, I do not see how to modify the view hierarchy.
Does anyone have a way to draw the bg image behind the mostly transparent game scene?