Re: "So, I guess my question is whether I should just add a gesture recognizer to my custom button class? Is this inefficient if I end up having 7-8 buttons on the screen and each one has its own gesture recognizer?"
Yes and no
I've been testing a few patterns and I think I'm coming to the conclusion that I'll end up having a single recognizer in each scene that finds/hands-off to the appropriate button. I was kinda hoping to compartmentalise it so that each button is able to deal with that but it feels like I'm fighting the framework if I do that.
Re: "what gesture recognizer lifecycle management do I need in a SpriteKit scene that is presented within a SpriteKitView?"
I'll assume you're referring to SpriteView, and like a typical SwiftUI View you add a .gesture modifier.
Sorry, I was a bit vague there... I was more talking about how the general guidance for gesture recognizer lifecycle is to add them to the view in didMove(to:) and then remove them just before transitioning to a new scene. Is this still the advice in a SwiftUI world? It seems so, but I wasn't sure if this had changed over time with the introduction of SwiftUI containing views.
Do your buttons have to be rendered in the SpriteView or could they be in a container View instead as a Button? You might find this separation of concerns cleaner, and possibly improves MVC clarity.
This was definitely one of the options I was exploring too. For the buttons that are a bit "chrome"-like, it kinda makes sense... but for the "in-game" buttons, it would mean splitting the game behaviour across SpriteKit and the hosting UI container (which I think would end up causing me more pain)
Do you really need SwiftUI for building a SpriteKit game?
Nah, definitely not. Xcode just happened to generate SwiftUI for me when I created the project. As it turns out, I'm not really "using" SwiftUI capability at all... it is just a dumb container for my scenes.
Many thanks for your feedback. Much appreciated.