In a regular project, adding a scrollView is easy enough:
https://www.youtube.com/watch?v=oQZ4mQpHXCo
But in a spriteKit
project this approach doesn't work (as far as I know) since you can't add you nodes to the UIView
(at least I didn't get it to work), resulting in a scrollable view
on top of the nodes, rather than the nodes being in the scrollable view.
In my project I have several nodes
drawn out as a game board with tiles
. I would like to be able to scroll on all directions by dragging across the screen the direction I want to go.
I read this SO
question and looked at the answer:
But there's a broken link that could perhaps be useful, and the scrollKit
honestly seems a bit hard to grasp, even though I have played around with it a bit. So, what approach should I take? Is there some way I can use a UIScrollView in a viewController
or is the scrollKit the way to go about this? And what about touchesMoved
? Can this be used to scroll the screen? I also looked at this:
But don't seem to be able to get it to work properly.