Skip to content
forked from evgenyneu/Cosmos

A star rating control for iOS/tvOS written in Swift

License

Notifications You must be signed in to change notification settings

tayyabejaz/Cosmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔨🔨🔨 This is work in progress 🔨🔨🔨

A star rating control for iOS / Swift

Star raiting control for iOS / Swift

This is a UI control for iOS that can be used to show user ratings for products.

  • Shows stars with optional text label.
  • Sizes, colors and margins are customizable.
  • Includes different star filling modes: full, half-filled and precise.
  • Can be used in the storyboard with Auto Layout.

Binary star system of Sirius A and Sirius B (artist's impression)

Picture of binary star system of Sirius A and Sirius B by NASA, ESA and G. Bacon (STScI). Source: spacetelescope.org.

Setup

There are three ways you can add Star to your Xcode project.

Add source (iOS 7+)

Simply add StarDistrib.swift file into your Xcode project.

Setup with Carthage (iOS 8+)

Alternatively, add github "exchangegroup/Star" ~> 1.0 to your Cartfile and run carthage update.

Setup with CocoaPods (iOS 8+)

If you are using CocoaPods add this text to your Podfile and run pod install.

use_frameworks!
pod 'Star', '~> 1.0'

Usage

  1. Add View control into your storyboard. Set its class to TegStarRatingView.
  2. Add an outlet for this view in your view controller.
  3. Use show method to display rating:
ratingView.show(rating: 4, text: "(132)")

Customization

Customization can be made by changing settings properties. For example:

ratingView.settings.starColorFilled = UIColor.blackColor()
ratingView.settings.starFillMode = TegStarFillMode.Precise

Demo app

This project includes a demo iOS app.

five star rating control for iOS written in Swift

Alternative solutions

Here are some other star rating controls for iOS:

License

Star is released under the MIT License.

About

A star rating control for iOS/tvOS written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 96.7%
  • Shell 1.6%
  • Other 1.7%