NumericPicker icon indicating copy to clipboard operation
NumericPicker copied to clipboard

Decrease the number of times each component is calculated

Open MattLewin opened this issue 7 years ago • 0 comments

Is your feature request related to a problem? Please describe. Each picker component is (re)calculated too frequently. While it may be necessary to recalculate and layout the picker when the number of digits in the picker changes or the font size changes, it seems like we are doing it far too frequently. As an example, NumericPicker-Example makes 644 calls to pickerView(_:titleForRow:forComponent:) before anything appears.

Describe the solution you'd like I want fewer calls made to pickerView(_:titleForRow:forComponent:), pickerView(_:viewForRow:forComponent:reusing:), pickerView(_:widthForComponent:), and pickerView(_:rowHeightForComponent:).

Describe alternatives you've considered Do nothing, as I've never noticed this in real-world app usage.

MattLewin avatar Sep 19 '18 22:09 MattLewin