I have my default UIView with two subviews. One is a UIButton and the other is an SKView. Pressing the button triggers an emitter in the SKView. It works fine if the SKView does not overlap the button. Once it does, however, the button no longer recognizes taps.
I have tried bringSubview(toFront:), and setting the zPosition of the subviews. Is there not a way to put the SKView under the button?
@IBOutlet weak var effectButton: UIButton!
@IBOutlet weak var effectView: SKView!
let effectsViewScene = EffectsViewScene()
override func viewDidLoad() {
super.viewDidLoad()
effectView.presentScene(effectsViewScene)
}
@IBAction func buttonTapped(_ sender: UIButton) {
effectsViewScene.beginEffects()
}
Try to sending SKView to back when you use bringSubView(front) method view.sendSubview(toBack: SKView) Hope this helps!