amr

AMRatingControl

A simple rating control for the iPhone

Showing:

Popularity

Downloads/wk

0

GitHub Stars

95

Maintenance

Last Commit

8yrs ago

Contributors

8

Package

Dependencies

0

License

MIT

Categories

Readme

This is a fork from jasarien/JSFavStarControl.

AMRatingControl is a UI control that resembles the 'star rating' control seen in the iPod app.

AMRatingControl allows you to select a rating starting from 0 to any number of stars you want.

You can use default star symbols and customize colors or specify custom images.

How To Get Started

- Using CocoaPods

pod 'AMRatingControl'

- Without CocoaPods

Add AMRatingControl.h and AMRatingControl.m to your project.

Example Usage

#include "AMRatingControl.h"

// Create a simple instance, initing with : // - a CGPoint (the position in your view from which it will be drawn) // - and max rating AMRatingControl *simpleRatingControl = [[AMRatingControl alloc] initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating];

// Customize the current rating if needed [ratingControl setRating:(NSInteger)rating];

// Define block to handle events simpleRatingControl.editingChangedBlock = ^(NSUInteger rating) { [label setText:[NSString stringWithFormat:@"%d", rating]]; };

simpleRatingControl.editingDidEndBlock = ^(NSUInteger rating) { [endLabel setText:[NSString stringWithFormat:@"%d", rating]]; };

// Create an instance with images, initing with : // - a CGPoint (the position in your view from which it will be drawn) // - a custom empty image and solid image if you wish (pass nil if you want to use the default). // - and max rating AMRatingControl imagesRatingControl = [[AMRatingControl alloc] initWithLocation:(CGPoint)location emptyImage:(UIImage )emptyImageOrNil solidImage:(UIImage *)solidImageOrNil andMaxRating:(NSInteger)maxRating];

// Create an instance with custom colors, initing with : // - a CGPoint (the position in your view from which it will be drawn) // - a custom empty image and solid image if you wish (pass nil if you want to use the default). // - and max rating AMRatingControl coloredRatingControl = [[AMRatingControl alloc] initWithLocation:(CGPoint)location emptyColor:(UIColor )emptyColorOrNi solidColor:(UIColor *)solidColorOrNi andMaxRating:(NSInteger)maxRating];

// Add the control(s) as subview of your view [view addSubview:simpleRatingControl]; [view addSubview:imagesRatingControl]; [view addSubview:coloredRatingControl];

Example ScreenShot

ARC

AMRatingControl uses ARC.

License

AMRatingControl is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100