Code Monkey home page Code Monkey logo

sratingview's Introduction

SRatingView

SRatingView simplifies rating visulatisation via a simple UIView subclass. It allows you to display any rating value easily, even with animation!

Sample

Requirements

  • iOS 6.0 or higher
  • Requires ARC

Installation

The easiest way to use SRatingView in your app is via CocoaPods.

  1. Add the following line in the project's Podfile file: pod 'SRatingView'
  2. Run the command pod install from the Podfile folder directory.

Usage

SRatingView requires an initial setup to display the rate value correctly. It assumes that you have both a filled and an empty rating image. For the example project i use these images:

Fill Image Empty Image

First we will assign these images accordingly:

    self.ratingView.ratingFillTileImage  = [UIImage imageNamed:@"rating-star"];
    self.ratingView.ratingEmptyTileImage = [UIImage imageNamed:@"rating-star-empty"];

The configuration requires how many tiles of these images will be used:

	[self.ratingView setNumberOfTiles:5];

The only thing left is to display the actual rate value:

    [self.ratingView setRateValue:0.3 animated:YES];

Result is here:

Result

Notes

For next version, i plan to add action to SRatingView,to make the user able to rate anything. Action will support both float and integer type of values.

License

Distributed under the permissive zlib license. See the LICENSE file for more info.

Contact

Selim Bakdemir

sratingview's People

Contributors

selim1377 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

cshireman

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.