Swift4.0 star rating Starview package, xib and pure code easy to use

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.