To do this purely in SpriteKit you essentially create a moveableNode and add all your menu stuff to that node and than you move that node in touchesMoved. You would have to keep track of its position and fiddle with the speed etc.
https://codedump.io/share/etvt4SwQI6iR/1/how-to-create-a-vertical-scrolling-menu-in-spritekit
I think this kind of menu is the rare occasion where it is actually better to use UIKit in SpriteKit, such as UIScrollViews or UICollectionViews.
Trying to replicate them in SpriteKit is a bit tricky, requires some extra code and also doesnt give you the nice scrolling/bounce effect.
You can create a UIColletionView in Spritekit if thats what you are looking for, you just need to subclass. I am using one for my game I am working on as the level select screen.
Create a new swift file
class CustomCollectionView: UICollectionView {
// MARK: - Init
init(frame: CGRect) {
super.init(frame: frame)
/// set up
backgroundColor = UIColor.clearColor()
#if os(iOS)
pagingEnabled = true
#endif
self.frame = frame
delegate = self
dataSource = self
indicatorStyle = .White
scrollEnabled = true
canCancelContentTouches = false
registerClass... // register your cells
}
// MARK: - Delegates
extension CustomCollectionView: UICollectionViewDataSource {
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return 5
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 8
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
.......
}
Then in your SKScenes you can add the collection View
weak var collectionView: CustomCollectionView!
collectionView = CustomCollectionView(frame: view!.frame)
view!.addSubview(collectionView)
You will have to read some tutorials so you can get comfortable with UICollectionView, like how to create custom cells and general setUp etc. You will also have to ensure that you remove the collectionView when changing SKScenes
collectionView.removeFromSuperview()
Is this what you are asking?