Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

toshi0383/RateTV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Carthage compatible Platform GitHub license

RateTV

An awesome Rating view for tvOS.

Fully configurable from InterfaceBuilder.

Focused view is invisible and separeted from visible UI.

Requirements

tvOS 9.0+

RateSlider

RateSlider can be used for user interaction.

Usage

Steps

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.

Rate value observing

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)")
            }
        }
    }

Size

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

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.

rate-core-graphic-view

Install

Use Carthage

LICENSE

MIT