What is the purpose of this property
``````
public class SliderCell: Cell
`````\
public var formatter: NSNumberFormatter?
`````\
}
``````
formatter is declared but i guess not using anywhere. I just want to display Integer value in valueLabel.
SliderRow.defaultCellSetup = { Cell,row in
let numberFormatter = NSNumberFormatter()
numberFormatter.numberStyle = .DecimalStyle
numberFormatter.minimumFractionDigits = 0
Cell.formatter = numberFormatter
}
defaultCellSetup and defaultCellUpdate not working anymore.
You do not need to use the formatter for this.
You should first correctly set the steps for your interval. And then make sure the value is displayed as an Int and not a Float.
In the examples there is a slider with the default values: minimumValue = 0.0, maximumValue = 10.0, steps = 20
So, adding the following lines solves your problem:
$0.steps = 10
$0.displayValueFor = {
return String(Int($0!))
}
Great
Most helpful comment
You do not need to use the formatter for this.
You should first correctly set the steps for your interval. And then make sure the value is displayed as an Int and not a Float.
In the examples there is a slider with the default values:
minimumValue = 0.0, maximumValue = 10.0, steps = 20So, adding the following lines solves your problem: