RatingControl
is a SwiftUI "rating" control (pretty self-explanatory). Anything can be used for empty and filled images (they can really be any type of view, not just Image
s).
Be default, each icon's frame is set by the size of the empty icon so changes to each icon's state doesn't change the overall position of the control. This can be changed with the .ratingControlIconFrameSizingMode(_:)
modifier.
While normal modifiers such as .foregroundColor(_:)
and .foregroundStyle(_:)
can be used to color/style the control, the .ratingControlEmptyIconColor(_:)
and .ratingControlFilledIconColor(_:)
modifiers can be used to color each type of icon separately.
- Figure out how to do partial values
- change bound value from
Int
toDouble
(useSlider
's initializers as reference for generic number) - use
.mask
modifier? - make sure to take into account padding
- figure out decimal maximumValues
- change bound value from
- for
.dynamic
sizing mode: maybe solution is to make an actualViewModifier
with a @State var that reads preferencekey changes and calculates the masking scale and calc's the frame width? - add tvOS exclusive modifier that specifies stride/increment
- also maybe replace Button with some sort of custom tvOS control where just pressing left/right changes the value by the increment
- add tappable increment via modifier
- add increment value to inits or environmentvalue
- this would affect dragging. if it's
nil
, full decimal values. otherwise, snap to values - also maybe alternate initializer that takes
Binding<Int>
?
- this would affect dragging. if it's