Fuck your custom slider
It doesn't work. Sure, it looks great, with gradients, and multiple thumbs, but really, it's useless. No more paying for a subscription on Medium only to find out yet again that your slider doesn't work for me. No more fumbling around with Xcode, trying to get it to create package dependencies (and holy shit, package dependencies? A whole package for a customizable slider that doesn't do anything special, it just looks cool?
Fuck my custom slider
It looks like crap, the code is crap, I barely understand SwiftUI, so the design and implementation are crap too. But it does do the things I wanted it to do, which your custom slider doesn't do, even after I did finally get Xcode to do the whole package dependency thing.
- Tickmarks
- Thumb snaps to tickmarks
- Resting thumb resists moving until you pull on it a bit
- Tap the track to move the thumb there instantly--will snap if close to a tickmark
- Double-tap the floating text to enter a value from the keyboard
😆
How to use - Clone.
- Select the macOS build. I don't yet have my Hogwarts Certificate for the Black Magic of iOS
- Run
- Barf/mock/curse the author
Just copy the files to your project; be sure to get the Primitives
folder, which has some of my crusty old standby helper utilities n stuff
Bonus Material!
Have a look at Shared/DragState.swift
to see a drag-n-drop state machine implemented using GKStateMachine
from Apple's GameplayKit
. SwiftUI is still slapping me around, but after all these years I've managed to learn some of Apple's tools