Coder Social home page Coder Social logo

swiftystarratingview's Introduction

####A simple star rating view written in pure swift, lightweight but powerful.

######🇨🇳中文介绍

##Screenshots

Requirements

  • iOS 8.0+
  • Xcode 8
  • Swift 3.0

##CocoaPods

CocoaPods is the recommended way to add SwiftyStarRatingView to your project.

Add a pod entry for SwiftyStarRatingView to your Podfile.

	pod 'SwiftyStarRatingView'

Second, install SwiftyStarRatingView into your project:

	pod install

Manually

  1. Download the latest code version .
  2. Open your project in Xcode,drag the SwiftyStarRatingView folder into your project. Make sure to select Copy items when asked if you extracted the code archive outside of your project.

Usage

####Create a simple rating view:

	let starRatingView = SwiftyStarRatingView()
	
	starRatingView.frame = CGRect(x: x, y: y, width: width, height: height)
	
	starRatingView.maximumValue = 5 		//default is 5
	starRatingView.minimumValue = 0 		//default is 0
	starRatingView.value = 3        		//default is 0
	
	starRatingView.tintColor = UIColor.yellow
	
	starRatingView.addTarget(self, action: #selector(function), for: .valueChanged)
	
	self.view.addSubview(starRatingView)

####Setting this property to control whether to display a half stars:

	starRatingView.allowsHalfStars = true 	//default is true
    starRatingView.value = 3.5				//default is 0

####Whether accurate display:

	starRatingView.accurateHalfStars = true //default is true

####Always callback or just stop touch:

	starRatingView.continuous = true        //default is true

####Use custom image:

	starRatingView.halfStarImage = UIImage(named: "half.png")
	starRatingView.emptyStarImage = UIImage(named: "empty.png")
    starRatingView.filledStarImage = UIImage(named: "filled.png")

####StoryBoard or XIB:

SwiftyStarRatingView also works great with Auto Layout, you can use it in StoryBoard or XIB.

Contacts

####If you wish to contact me, email at: [email protected]

#####Sina : @后知后觉乀

License

SwiftyStarRatingView is released under the GNU GENERAL PUBLIC LICENSE. See LICENSE for details.

swiftystarratingview's People

Contributors

jerrrr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.