An awesome Rating view for tvOS.
Fully configurable from InterfaceBuilder.
Focused view is invisible and separeted from visible UI.
tvOS 9.0+
RateSlider can be used for user interaction.
Available Rate steps
- half step: 0.0, 0.5, 1.0, 1.5...
- full step: 0.0, 1.0, 2.0 ...
If you prefer half step, set Half Image
property.
If you prefer full step, clear out Half Image
property.
To observe rate value change, use RateSlider.rateValueDidChange
callback closure.
@IBOutlet weak var input: RateSlider! {
didSet {
input.rateValueDidChange = {
[weak self] value in
print("value: \(value)")
}
}
}
RateSlider's size is inferred from image's size using AutoLayout.
Make sure that every image is in the same size as you expect it to be.
RateCoreGraphicView can display any float values like 0.1
.
You set full and zero image, then RateCoreGraphicView will draw and clip the image for you.
Stars are drawn with CoreGraphic API, inside draw(rect:)
.
Make sure you set RateCoreGraphicView's size correctly.
Star's size is inferred from image's size as well as RateSlider.
Use Carthage
MIT