Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created April 6, 2020 06:55
Show Gist options
  • Save wizard1066/e7f437464258dab024bc2ebc092fc065 to your computer and use it in GitHub Desktop.
Save wizard1066/e7f437464258dab024bc2ebc092fc065 to your computer and use it in GitHub Desktop.
abgwtp18
HStack(alignment: .center) {
Spacer().padding()
Stepper("Cell", onIncrement: {
if self.sliderValue < cellsUsed(sliderDB: self.sliderDB, figures: self.rect.count) {
let (id, figure, color) = self.sliderDB[Int(self.sliderValue)]
if id != nil {
self.textText[id!] = figure!
self.textColors[id!] = color!
}
self.sliderValue += 1
}
}, onDecrement: {
if self.sliderValue != 0 {
self.sliderValue -= 1
let (id, _, _) = self.sliderDB[Int(self.sliderValue)]
if id != nil {
self.textText[id!] = ""
self.textColors[id!] = Color.clear
}
}
}).font(Fonts.futuraCondensedMedium(size: 20))
Spacer().padding()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment