struct ContentView: View {
   @State private var currentValue: Float = 5

   var body: some View {
      VStack {
         Text("Current Value: \(currentValue.formatted(.number.precision(.fractionLength(0))))")
         Slider(value: $currentValue, in: 0...10, step: 1.0, label: {}, tick: { value in
            let position = Int(value)
            if position % 2 == 0 {
               return SliderTick(value, label: {
                  Text(String(position))
               })
            } else {
               return nil
            }
         })
         Spacer()
      }.padding()
   }
}