0

How can I build or get (library) a PagerView in WatchOS. I can't find a way to do it without SwiftUI. I have a library for UIKit (https://github.com/WenchaoD/FSPagerView) but i cant use it for watchOS

SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96

1 Answers1

0

Use SpriteKit for custom ui on watchOS

If you can't use SwiftUI, WatchOS only has SpriteKit and SceneKit.

Your app isn't a game, but there's no difference to the computer, only to the user. A game is just a fun app.

You need to have a WKInterfaceController that hosts a WKInterfaceSKScene view and the WKInterfaceSKScene presents an SKScene

For a pager type view of images that you can swipe between, then you might have a scene with some SKSpriteNodes, for example 3, with one on screen, one to the left, one to the right, and move them around and change their images as user drags about. Or whatever you want, maybe a SKTileMapNode or so. For dragging, maybe a WKPanGestureRecognizer on the WKInterfaceController - you need to ensure you're not in a paged based interface, only fullscreen or navigation based would work for that. You also want to allow the crown to be used, so implement WKCrownDelegate

Shadowrun
  • 3,572
  • 1
  • 15
  • 13