Github:https://github.com/rainmango/zystarview
Zystarview
Introduction
Swift star display, selected package Xib, and pure code are all available (Xib experience) support for star setting: Divide the stars in one area to set the star number calculation unit: Support A star, half star, random float custom display animation settings: Click on the star to display the animation callback: The number of stars is set to return the current number of stars as callback support Xib:xib StoryBoard create a direct corresponding class. Properties support KeyPath code usage
Create Starview and callback the current selected number of stars, parameter description see note very clearly let
Starview = Zystarrateview.init (Frame:CGRect.init (x: ( uiscreen.main.bounds.width-320)/2, y:600, width:320, height:100), Starcount:8, Currentstar:2, RateStyle:. Half) {( Current)-(Void) in
print (current)
}
How to use Xib code
Gray is often simple, if just show do not callback do not need to write code. Demo