The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
CocoaPods is the recommended way to add SwiftyStarRatingView to your project.
Add a pod entry for SwiftyStarRatingView to your Podfile.
Second, install SwiftyStarRatingView into your project:
If you prefer to install SwiftyStarRatingView via Carthage include the following line in your Cartfile:
SwiftyStarRatingViewfolder into your project. Make sure to select Copy items when asked if you extracted the code archive outside of your project.
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)
starRatingView.allowsHalfStars = true //default is true starRatingView.value = 3.5 //default is 0
starRatingView.accurateHalfStars = true //default is true
starRatingView.continuous = true //default is true
starRatingView.halfStarImage = UIImage(named: "half.png") starRatingView.emptyStarImage = UIImage(named: "empty.png") starRatingView.filledStarImage = UIImage(named: "filled.png")
SwiftyStarRatingViewalso works great with Auto Layout, you can use it in StoryBoard or XIB.
SwiftyStarRatingView is released under the GNU GENERAL PUBLIC LICENSE. See LICENSE for details.