From cf2813d8cbd330ea393468fb548a21f0ec9e661c Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:18:13 -0700 Subject: [PATCH 01/30] modified star control to display partial ratings --- Classes/StarRatingControl.h | 80 ++++ Classes/StarRatingControl.m | 412 ++++++++++++++++++ Demo/App/StarRatingControlAppDelegate.h | 21 + Demo/App/StarRatingControlAppDelegate.m | 25 ++ .../StarRatingControlViewController.h | 10 + .../StarRatingControlViewController.m | 78 ++++ .../StarRatingControlViewController.xib | 74 ++++ LICENSE | 0 MainWindow.xib | 303 ++----------- README.mdown | 24 +- StarRatingControl-Info.plist | 32 ++ StarRatingControl.xcodeproj/project.pbxproj | 304 +++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/StarRatingControl.xccheckout | 41 ++ StarRatingControl_Prefix.pch | 8 + dot.png | Bin index.html | 0 main.m | 2 +- screenshot.png | Bin star.png | Bin 20 files changed, 1140 insertions(+), 281 deletions(-) create mode 100755 Classes/StarRatingControl.h create mode 100755 Classes/StarRatingControl.m create mode 100755 Demo/App/StarRatingControlAppDelegate.h create mode 100755 Demo/App/StarRatingControlAppDelegate.m create mode 100755 Demo/Controller/StarRatingControlViewController.h create mode 100755 Demo/Controller/StarRatingControlViewController.m create mode 100755 Demo/Controller/StarRatingControlViewController.xib mode change 100644 => 100755 LICENSE mode change 100644 => 100755 MainWindow.xib mode change 100644 => 100755 README.mdown create mode 100755 StarRatingControl-Info.plist create mode 100755 StarRatingControl.xcodeproj/project.pbxproj create mode 100755 StarRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 StarRatingControl.xcodeproj/project.xcworkspace/xcshareddata/StarRatingControl.xccheckout create mode 100755 StarRatingControl_Prefix.pch mode change 100644 => 100755 dot.png mode change 100644 => 100755 index.html mode change 100644 => 100755 main.m mode change 100644 => 100755 screenshot.png mode change 100644 => 100755 star.png diff --git a/Classes/StarRatingControl.h b/Classes/StarRatingControl.h new file mode 100755 index 0000000..dc288de --- /dev/null +++ b/Classes/StarRatingControl.h @@ -0,0 +1,80 @@ +// +// StarRatingControl.h +// RatingControl +// + + +#import + +typedef void (^EditingChangedBlock)(NSUInteger rating); +typedef void (^EditingDidEndBlock)(NSUInteger rating); + + +@interface StarRatingControl : UIControl + + +/**************************************************************************************************/ +#pragma mark - Getters and Setters + +@property (nonatomic, assign) NSInteger maxRating; +@property (nonatomic, assign) NSInteger rating; +@property (nonatomic, assign) float partialRating; +//@property (nonatomic, assign) BOOL ; +@property (nonatomic, readwrite) NSUInteger starFontSize; +@property (nonatomic, readwrite) NSUInteger starWidthAndHeight; +@property (nonatomic, readwrite) NSUInteger starSpacing; +@property (nonatomic, copy) EditingChangedBlock editingChangedBlock; +@property (nonatomic, copy) EditingDidEndBlock editingDidEndBlock; + +/**************************************************************************************************/ +#pragma mark - Birth & Death + +/** + * @param location : position of the rating control in your view + * The control will manage its own width/height (kind of like UIActivityIndicator) + * @param maxRating + */ +- (id)initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating; + +/** + * @param location : position of the rating control in your view + * The control will manage its own width/height (kind of like UIActivityIndicator) + * @param emptyColor & solidColor + * @param maxRating + */ +- (id)initWithLocation:(CGPoint)location + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + andMaxRating:(NSInteger)maxRating; + +/** + * @param location : position of the rating control in your view + * The control will manage its own width/height (kind of like UIActivityIndicator) + * @param emptyImage & solidImage can both be nil, or not even a dot or a star (a any images you want!) + * If either of these parameters are nil, the class will draw its own stars + * @param maxRating + */ +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + andMaxRating:(NSInteger)maxRating; + +/** + * @param location : position of the rating control in your view + * The control will manage its own width/height (kind of like UIActivityIndicator) + * @param emptyImage & solidImage can both be nil, or not even a dot or a star (a any images you want!) + * If either of these parameters are nil, the class will draw its own stars + * @param userInteractionEnabled - self explanatory + * @param initialRating will initialize the number of stars and partial stars to show with the control at startup + * @param maxRating + * + */ +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil +userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:(NSInteger)maxRating; + + +@end diff --git a/Classes/StarRatingControl.m b/Classes/StarRatingControl.m new file mode 100755 index 0000000..f756483 --- /dev/null +++ b/Classes/StarRatingControl.m @@ -0,0 +1,412 @@ +// +// StarRatingControl.m +// RatingControl +// + + +#import "StarRatingControl.h" + + +// Constants : +static const CGFloat kFontSize = 20; +static const NSInteger kStarWidthAndHeight = 20; +static const NSInteger kStarSpacing = 0; + +static const NSString *kDefaultEmptyChar = @"☆"; +static const NSString *kDefaultSolidChar = @"★"; + + +@interface StarRatingControl (Private) + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + andMaxRating:(NSInteger)maxRating; + +- (void)adjustFrame; +- (void)handleTouch:(UITouch *)touch; + +@end + + +@implementation StarRatingControl +{ + BOOL _respondsToTranslatesAutoresizingMaskIntoConstraints; + UIImage *_emptyImage, *_solidImage; + UIColor *_emptyColor, *_solidColor; + NSInteger _maxRating; +} + +/**************************************************************************************************/ +#pragma mark - Getters & Setters + +- (void)setMaxRating:(NSInteger)maxRating +{ + _maxRating = maxRating; + if (_rating > maxRating) { + _rating = maxRating; + } + [self adjustFrame]; + [self setNeedsDisplay]; +} + +- (void)setRating:(NSInteger)rating +{ + _rating = (rating < 0) ? 0 : rating; + _rating = (rating > _maxRating) ? _maxRating : rating; + [self setNeedsDisplay]; +} + +- (void)setStarWidthAndHeight:(NSUInteger)starWidthAndHeight +{ + _starWidthAndHeight = starWidthAndHeight; + [self adjustFrame]; + [self setNeedsDisplay]; +} + +- (void)setStarSpacing:(NSUInteger)starSpacing +{ + _starSpacing = starSpacing; + [self adjustFrame]; + [self setNeedsDisplay]; +} + +/**************************************************************************************************/ +#pragma mark - Birth & Death + +- (id)initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating +{ + return [self initWithLocation:location + emptyImage:nil + solidImage:nil + emptyColor:nil + solidColor:nil + andMaxRating:maxRating]; +} + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + andMaxRating:(NSInteger)maxRating +{ + return [self initWithLocation:location + emptyImage:emptyImageOrNil + solidImage:solidImageOrNil + emptyColor:nil + solidColor:nil + andMaxRating:maxRating]; +} + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil +userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:(NSInteger)maxRating +{ + return [self initWithLocation:location + emptyImage:emptyImageOrNil + solidImage:solidImageOrNil + emptyColor:nil + solidColor:nil + userInteractionEnabled:userInteractionEnabled + initialRating:initialRating + andMaxRating:maxRating]; +} + +- (id)initWithLocation:(CGPoint)location + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + andMaxRating:(NSInteger)maxRating +{ + return [self initWithLocation:location + emptyImage:nil + solidImage:nil + emptyColor:emptyColor + solidColor:solidColor + andMaxRating:maxRating]; +} + +- (void)dealloc +{ + _emptyImage = nil, + _solidImage = nil; + _emptyColor = nil; + _solidColor = nil; +} + +/**************************************************************************************************/ +#pragma mark - Auto Layout + +- (CGSize)intrinsicContentSize +{ + return CGSizeMake(_maxRating * _starWidthAndHeight + (_maxRating - 1) * _starSpacing, + _starWidthAndHeight); +} + + +/**************************************************************************************************/ +#pragma mark - View Lifecycle + +- (void)drawRect:(CGRect)rect +{ + CGPoint currPoint = CGPointZero; + + for (int i = 0; i < _rating; i++) + { + if (_solidImage) + { + [_solidImage drawAtPoint:currPoint]; + } + else + { + CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), _solidColor.CGColor); + [kDefaultSolidChar drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_starFontSize]]; + } + + currPoint.x += (_starWidthAndHeight + _starSpacing); + } + + if (_partialRating > 0.0) { + UIImage *partialStar = [self partialImage:_solidImage fraction:_partialRating]; + [partialStar drawAtPoint:currPoint]; + currPoint.x += (_starWidthAndHeight + _starSpacing); + } + + NSInteger remaining = (floor)(_maxRating - _rating - _partialRating) ; + + for (int i = 0; i < remaining; i++) + { + if (_emptyImage) + { + [_emptyImage drawAtPoint:currPoint]; + } + else + { + CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), _emptyColor.CGColor); + [kDefaultEmptyChar drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_starFontSize]]; + } + currPoint.x += (_starWidthAndHeight + _starSpacing); + } +} + + +/**************************************************************************************************/ +#pragma mark - UIControl + +- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event +{ + [self handleTouch:touch]; + return YES; +} + +- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event +{ + [self handleTouch:touch]; + return YES; +} + +- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event +{ + if (self.editingDidEndBlock) + { + self.editingDidEndBlock(_rating); + } +} + + +/**************************************************************************************************/ +#pragma mark - Private Methods + + +- (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + andMaxRating:(NSInteger)maxRating +{ + [self initializeWithEmptyImage:emptyImageOrNil + solidImage:solidImageOrNil + emptyColor:emptyColor + solidColor:solidColor + userInteractionEnabled:YES + initialRating:0.0 + andMaxRating:maxRating]; +} + +- (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:(NSInteger)maxRating +{ + _respondsToTranslatesAutoresizingMaskIntoConstraints = [self respondsToSelector:@selector(translatesAutoresizingMaskIntoConstraints)]; + + _rating = 0; + self.backgroundColor = [UIColor clearColor]; + self.opaque = NO; + + _emptyImage = emptyImageOrNil; + _solidImage = solidImageOrNil; + _emptyColor = emptyColor; + _solidColor = solidColor; + _maxRating = maxRating; + _rating = (int)(floor(initialRating)); + _partialRating = initialRating - (float)_rating; + _starFontSize = kFontSize; + _starWidthAndHeight = kStarWidthAndHeight; + _starSpacing = kStarSpacing; + self.userInteractionEnabled = userInteractionEnabled; +} + +- (id)initWithCoder:(NSCoder *)decoder +{ + self = [super initWithCoder:decoder]; + if (self) { + [self initializeWithEmptyImage:nil + solidImage:nil + emptyColor:nil + solidColor:nil + userInteractionEnabled:YES + initialRating:0.0 + andMaxRating:0]; + } + return self; +} + + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor +userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:(NSInteger)maxRating +{ + if (self = [self initWithFrame:CGRectMake(location.x, + location.y, + (maxRating * kStarWidthAndHeight), + kStarWidthAndHeight)]) + { + [self initializeWithEmptyImage:emptyImageOrNil + solidImage:solidImageOrNil + emptyColor:emptyColor + solidColor:solidColor + userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:maxRating]; + } + + return self; +} + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + emptyColor:(UIColor *)emptyColor + solidColor:(UIColor *)solidColor + andMaxRating:(NSInteger)maxRating +{ + if (self = [self initWithFrame:CGRectMake(location.x, + location.y, + (maxRating * kStarWidthAndHeight), + kStarWidthAndHeight)]) + { + [self initializeWithEmptyImage:emptyImageOrNil + solidImage:solidImageOrNil + emptyColor:emptyColor + solidColor:solidColor + userInteractionEnabled:YES + initialRating:0.0f + andMaxRating:maxRating]; + } + + return self; +} + + +- (void)adjustFrame +{ + if (_respondsToTranslatesAutoresizingMaskIntoConstraints && !self.translatesAutoresizingMaskIntoConstraints) + { + [self invalidateIntrinsicContentSize]; + } + else + { + CGRect newFrame = CGRectMake(self.frame.origin.x, + self.frame.origin.y, + _maxRating * _starWidthAndHeight + (_maxRating - 1) * _starSpacing, + _starWidthAndHeight); + self.frame = newFrame; + } +} + +- (void)handleTouch:(UITouch *)touch +{ + if (!self.userInteractionEnabled) { + return; + } + CGFloat width = self.frame.size.width; + CGRect section = CGRectMake(0, 0, _starWidthAndHeight, self.frame.size.height); + + CGPoint touchLocation = [touch locationInView:self]; + + if (touchLocation.x < 0) + { + if (_rating != 0) + { + _rating = 0; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + } + else if (touchLocation.x > width) + { + if (_rating != _maxRating) + { + _rating = _maxRating; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + } + else + { + for (int i = 0 ; i < _maxRating ; i++) + { + if ((touchLocation.x > section.origin.x) && (touchLocation.x < (section.origin.x + _starWidthAndHeight))) + { + if (_rating != (i + 1)) + { + _rating = i + 1; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + break; + } + section.origin.x += (_starWidthAndHeight + _starSpacing); + } + } + [self setNeedsDisplay]; +} + +- (UIImage *) partialImage:(UIImage *)image fraction:(float)fraction +{ + CGImageRef imgRef = image.CGImage; + CGImageRef fractionalImgRef = CGImageCreateWithImageInRect(imgRef, CGRectMake(0, 0, image.size.width * fraction, image.size.height)); + UIImage *fractionalImg = [UIImage imageWithCGImage:fractionalImgRef]; + CGImageRelease(fractionalImgRef); + return fractionalImg; +} + +@end diff --git a/Demo/App/StarRatingControlAppDelegate.h b/Demo/App/StarRatingControlAppDelegate.h new file mode 100755 index 0000000..b3403c4 --- /dev/null +++ b/Demo/App/StarRatingControlAppDelegate.h @@ -0,0 +1,21 @@ +#import + + +@class StarRatingControlViewController; + + +@interface StarRatingControlAppDelegate : NSObject +{ + UIWindow *window; + StarRatingControlViewController *viewController; +} + + +/**************************************************************************************************/ +#pragma mark - Getters & Setters + +@property (nonatomic, strong) IBOutlet UIWindow *window; +@property (nonatomic, strong) IBOutlet StarRatingControlViewController *viewController; + + +@end diff --git a/Demo/App/StarRatingControlAppDelegate.m b/Demo/App/StarRatingControlAppDelegate.m new file mode 100755 index 0000000..adcf661 --- /dev/null +++ b/Demo/App/StarRatingControlAppDelegate.m @@ -0,0 +1,25 @@ +#import "StarRatingControlAppDelegate.h" +#import "StarRatingControlViewController.h" + + +@implementation StarRatingControlAppDelegate + + +/**************************************************************************************************/ +#pragma mark - Getters & Setters + +@synthesize window; +@synthesize viewController; + + +/**************************************************************************************************/ +#pragma mark - Application Lifecycle + +- (void)applicationDidFinishLaunching:(UIApplication *)application +{ + [self.window setRootViewController:viewController]; + [window makeKeyAndVisible]; +} + + +@end diff --git a/Demo/Controller/StarRatingControlViewController.h b/Demo/Controller/StarRatingControlViewController.h new file mode 100755 index 0000000..eda9b67 --- /dev/null +++ b/Demo/Controller/StarRatingControlViewController.h @@ -0,0 +1,10 @@ +#import + +@interface StarRatingControlViewController : UIViewController +{ + IBOutlet UILabel *label; + IBOutlet UILabel *endLabel; +} + +@end + diff --git a/Demo/Controller/StarRatingControlViewController.m b/Demo/Controller/StarRatingControlViewController.m new file mode 100755 index 0000000..ebcd703 --- /dev/null +++ b/Demo/Controller/StarRatingControlViewController.m @@ -0,0 +1,78 @@ +#import "StarRatingControlViewController.h" +#import "StarRatingControl.h" + + +@interface StarRatingControlViewController (Private) + +- (void)updateRating:(id)sender; +- (void)updateEndRating:(id)sender; + +@end + + +@implementation StarRatingControlViewController + + +/**************************************************************************************************/ +#pragma mark - View Lifecycle + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // Create a simple instance, initing with : + // - a CGPoint (the position in your view from which it will be drawn) + // - and max rating + StarRatingControl *simpleRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(90, 50) + andMaxRating:5]; + + // Customize the current rating if needed + [simpleRatingControl setRating:3]; + [simpleRatingControl setStarSpacing:10]; + + // 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 + UIImage *dot, *star; + dot = [UIImage imageNamed:@"dot.png"]; + star = [UIImage imageNamed:@"star.png"]; + StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 250) + emptyImage:nil + solidImage:star + userInteractionEnabled:NO + initialRating:3.6 + andMaxRating:5]; + + // Create an instance with custom color, 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 + StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 370) + emptyColor:[UIColor yellowColor] + solidColor:[UIColor redColor] + andMaxRating:5]; + + + + + // Add the control(s) as a subview of your view + [self.view addSubview:simpleRatingControl]; + [self.view addSubview:imagesRatingControl]; + [self.view addSubview:coloredRatingControl]; +} + + +@end diff --git a/Demo/Controller/StarRatingControlViewController.xib b/Demo/Controller/StarRatingControlViewController.xib new file mode 100755 index 0000000..7ee9319 --- /dev/null +++ b/Demo/Controller/StarRatingControlViewController.xib @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/MainWindow.xib b/MainWindow.xib old mode 100644 new mode 100755 index 22c2deb..030b976 --- a/MainWindow.xib +++ b/MainWindow.xib @@ -1,268 +1,35 @@ - - - - 1536 - 11G56 - 2840 - 1138.51 - 569.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1926 - - - YES - IBProxyObject - IBUICustomObject - IBUIViewController - IBUIWindow - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - AMRatingControlViewController - - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - 292 - {320, 480} - - 1 - MSAxIDEAA - - NO - NO - - IBCocoaTouchFramework - - - - - YES - - - delegate - - - - 4 - - - - viewController - - - - 11 - - - - window - - - - 14 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - 3 - - - - - -2 - - - - - 10 - - - - - 12 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 10.CustomClassName - 10.IBPluginDependency - 12.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AMRatingControlViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AMRatingControlAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 14 - - - - YES - - AMRatingControlAppDelegate - NSObject - - YES - - YES - viewController - window - - - YES - AMRatingControlViewController - UIWindow - - - - YES - - YES - viewController - window - - - YES - - viewController - AMRatingControlViewController - - - window - UIWindow - - - - - IBProjectSource - ./Classes/AMRatingControlAppDelegate.h - - - - AMRatingControlViewController - UIViewController - - YES - - YES - endLabel - label - - - YES - UILabel - UILabel - - - - YES - - YES - endLabel - label - - - YES - - endLabel - UILabel - - - label - UILabel - - - - - IBProjectSource - ./Classes/AMRatingControlViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1926 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.mdown b/README.mdown old mode 100644 new mode 100755 index 2e0b686..e41cc3f --- a/README.mdown +++ b/README.mdown @@ -1,10 +1,10 @@ -# AMRatingControl +# StarRatingControl ###### This is a fork from [jasarien/JSFavStarControl](https://github.com/jasarien/JSFavStarControl). -AMRatingControl is a UI control that resembles the 'star rating' control seen in the iPod app. +StarRatingControl 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. +StarRatingControl 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. @@ -14,12 +14,12 @@ You can use default star symbols and customize colors or specify custom images. **- Using [CocoaPods](http://cocoapods.org/)** ``` ruby -pod 'AMRatingControl' +pod 'StarRatingControl' ``` **- Without CocoaPods** -Add `AMRatingControl.h` and `AMRatingControl.m` to your project. +Add `StarRatingControl.h` and `StarRatingControl.m` to your project. ## Example Usage @@ -27,12 +27,12 @@ Add `AMRatingControl.h` and `AMRatingControl.m` to your project. ``` objective-c -#include "AMRatingControl.h" +#include "StarRatingControl.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 +StarRatingControl *simpleRatingControl = [[StarRatingControl alloc] initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating]; // Customize the current rating if needed @@ -53,7 +53,7 @@ simpleRatingControl.editingDidEndBlock = ^(NSUInteger rating) // - 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 +StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil andMaxRating:(NSInteger)maxRating]; @@ -62,7 +62,7 @@ AMRatingControl *imagesRatingControl = [[AMRatingControl alloc] initWithLocation // - 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 +StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:(CGPoint)location emptyColor:(UIColor *)emptyColorOrNi solidColor:(UIColor *)solidColorOrNi andMaxRating:(NSInteger)maxRating]; @@ -73,13 +73,13 @@ AMRatingControl *coloredRatingControl = [[AMRatingControl alloc] initWithLocatio [view addSubview:coloredRatingControl]; ``` -Example ScreenShot +Example ScreenShot ## ARC -AMRatingControl uses ARC. +StarRatingControl uses ARC. ## License -AMRatingControl is available under the MIT license. See the LICENSE file for more info. +StarRatingControl is available under the MIT license. See the LICENSE file for more info. diff --git a/StarRatingControl-Info.plist b/StarRatingControl-Info.plist new file mode 100755 index 0000000..50753fb --- /dev/null +++ b/StarRatingControl-Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.xeniah.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.0.0 + CFBundleSignature + ???? + CFBundleVersion + 2.0.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + + diff --git a/StarRatingControl.xcodeproj/project.pbxproj b/StarRatingControl.xcodeproj/project.pbxproj new file mode 100755 index 0000000..46ac5b4 --- /dev/null +++ b/StarRatingControl.xcodeproj/project.pbxproj @@ -0,0 +1,304 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 758D370E112C04F6003C8E62 /* StarRatingControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 758D370D112C04F6003C8E62 /* StarRatingControl.m */; }; + 758D3711112C0881003C8E62 /* dot.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D370F112C0881003C8E62 /* dot.png */; }; + 758D3712112C0881003C8E62 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D3710112C0881003C8E62 /* star.png */; }; + C94C7B021619D449008701B7 /* StarRatingControlAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */; }; + C94C7B031619D449008701B7 /* StarRatingControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7B001619D449008701B7 /* StarRatingControlViewController.m */; }; + C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C94C7B011619D449008701B7 /* StarRatingControlViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* StarRatingControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StarRatingControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* StarRatingControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControl_Prefix.pch; sourceTree = ""; }; + 758D370C112C04F6003C8E62 /* StarRatingControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControl.h; sourceTree = ""; }; + 758D370D112C04F6003C8E62 /* StarRatingControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControl.m; sourceTree = ""; }; + 758D370F112C0881003C8E62 /* dot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot.png; sourceTree = ""; }; + 758D3710112C0881003C8E62 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* StarRatingControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "StarRatingControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + C94C7AFC1619D449008701B7 /* StarRatingControlAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlAppDelegate.h; sourceTree = ""; }; + C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControlAppDelegate.m; sourceTree = ""; }; + C94C7AFF1619D449008701B7 /* StarRatingControlViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlViewController.h; sourceTree = ""; }; + C94C7B001619D449008701B7 /* StarRatingControlViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControlViewController.m; sourceTree = ""; }; + C94C7B011619D449008701B7 /* StarRatingControlViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = StarRatingControlViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 758D370C112C04F6003C8E62 /* StarRatingControl.h */, + 758D370D112C04F6003C8E62 /* StarRatingControl.m */, + C94C7AFA1619D41D008701B7 /* Demo */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* StarRatingControl.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* StarRatingControl_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 758D370F112C0881003C8E62 /* dot.png */, + 758D3710112C0881003C8E62 /* star.png */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* StarRatingControl-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C94C7AFA1619D41D008701B7 /* Demo */ = { + isa = PBXGroup; + children = ( + C94C7AFB1619D449008701B7 /* App */, + C94C7AFE1619D449008701B7 /* Controller */, + ); + name = Demo; + path = ../Demo; + sourceTree = ""; + }; + C94C7AFB1619D449008701B7 /* App */ = { + isa = PBXGroup; + children = ( + C94C7AFC1619D449008701B7 /* StarRatingControlAppDelegate.h */, + C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */, + ); + path = App; + sourceTree = ""; + }; + C94C7AFE1619D449008701B7 /* Controller */ = { + isa = PBXGroup; + children = ( + C94C7AFF1619D449008701B7 /* StarRatingControlViewController.h */, + C94C7B001619D449008701B7 /* StarRatingControlViewController.m */, + C94C7B011619D449008701B7 /* StarRatingControlViewController.xib */, + ); + path = Controller; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* StarRatingControl */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StarRatingControl" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = StarRatingControl; + productName = FavStarControl; + productReference = 1D6058910D05DD3D006BFB54 /* StarRatingControl.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StarRatingControl" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* StarRatingControl */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 758D3711112C0881003C8E62 /* dot.png in Resources */, + 758D3712112C0881003C8E62 /* star.png in Resources */, + C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 758D370E112C04F6003C8E62 /* StarRatingControl.m in Sources */, + C94C7B021619D449008701B7 /* StarRatingControlAppDelegate.m in Sources */, + C94C7B031619D449008701B7 /* StarRatingControlViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = StarRatingControl_Prefix.pch; + INFOPLIST_FILE = "StarRatingControl-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_NAME = StarRatingControl; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = StarRatingControl_Prefix.pch; + INFOPLIST_FILE = "StarRatingControl-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + PRODUCT_NAME = StarRatingControl; + SDKROOT = iphoneos; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StarRatingControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StarRatingControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/StarRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/StarRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..11b1074 --- /dev/null +++ b/StarRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/StarRatingControl.xcodeproj/project.xcworkspace/xcshareddata/StarRatingControl.xccheckout b/StarRatingControl.xcodeproj/project.xcworkspace/xcshareddata/StarRatingControl.xccheckout new file mode 100644 index 0000000..d7090fc --- /dev/null +++ b/StarRatingControl.xcodeproj/project.xcworkspace/xcshareddata/StarRatingControl.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + BC486B43-75F5-4B16-9657-255970113E15 + IDESourceControlProjectName + StarRatingControl + IDESourceControlProjectOriginsDictionary + + 70E163FE-146A-4616-B282-718C3EBD2431 + ssh://github.com/xeniah/StarRatingControl.git + + IDESourceControlProjectPath + StarRatingControl.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 70E163FE-146A-4616-B282-718C3EBD2431 + ../.. + + IDESourceControlProjectURL + ssh://github.com/xeniah/StarRatingControl.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 70E163FE-146A-4616-B282-718C3EBD2431 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 70E163FE-146A-4616-B282-718C3EBD2431 + IDESourceControlWCCName + StarRatingControl + + + + diff --git a/StarRatingControl_Prefix.pch b/StarRatingControl_Prefix.pch new file mode 100755 index 0000000..1f85378 --- /dev/null +++ b/StarRatingControl_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'RatingControl' target in the 'RatingControl' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/dot.png b/dot.png old mode 100644 new mode 100755 diff --git a/index.html b/index.html old mode 100644 new mode 100755 diff --git a/main.m b/main.m old mode 100644 new mode 100755 index 3131713..c2e1e62 --- a/main.m +++ b/main.m @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) { @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); + int retVal = UIApplicationMain(argc, argv, nil, @"StarRatingControlAppDelegate"); return retVal; } } diff --git a/screenshot.png b/screenshot.png old mode 100644 new mode 100755 diff --git a/star.png b/star.png old mode 100644 new mode 100755 From a31345982001b7a49477ed160643ac0e388b3192 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:23:10 -0700 Subject: [PATCH 02/30] started to edit README. Deleted files --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index e41cc3f..050da0e 100755 --- a/README.mdown +++ b/README.mdown @@ -1,6 +1,6 @@ # StarRatingControl -###### This is a fork from [jasarien/JSFavStarControl](https://github.com/jasarien/JSFavStarControl). +###### This is a fork from [amseddi/AMRatingControl](https://github.com/amseddi/AMRatingControl). StarRatingControl is a UI control that resembles the 'star rating' control seen in the iPod app. From 2c9a9e33893712986c83850d97d3a51d54fda567 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:26:42 -0700 Subject: [PATCH 03/30] Delete AMRatingControl-Info.plist --- AMRatingControl-Info.plist | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 AMRatingControl-Info.plist diff --git a/AMRatingControl-Info.plist b/AMRatingControl-Info.plist deleted file mode 100644 index 818a042..0000000 --- a/AMRatingControl-Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.2.0 - CFBundleSignature - ???? - CFBundleVersion - 1.2.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow - - From 0de77ae62b2a7a05cabe91264826427e870a3a1e Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:26:56 -0700 Subject: [PATCH 04/30] Delete AMRatingControl.podspec --- AMRatingControl.podspec | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 AMRatingControl.podspec diff --git a/AMRatingControl.podspec b/AMRatingControl.podspec deleted file mode 100644 index f8ef8f8..0000000 --- a/AMRatingControl.podspec +++ /dev/null @@ -1,24 +0,0 @@ -Pod::Spec.new do |s| - s.name = "AMRatingControl" - s.version = "1.3.0" - s.summary = "A simple rating control for the iPhone." - s.description = <<-DESC - 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. - DESC - s.homepage = "https://github.com/amseddi/AMRatingControl" - - s.license = { :type => 'MIT', :file => 'LICENSE' } - - s.author = "amseddi" - s.source = { :git => "https://github.com/amseddi/AMRatingControl.git", :tag => "1.3.0" } - - s.platform = :ios, '5.0' - - s.source_files = 'Classes' - - s.resources = "star.png", "dot.png" - - s.requires_arc = true -end From 4860cfaea9c8d771fac94ef67a67f8f7a3531863 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:27:08 -0700 Subject: [PATCH 05/30] Delete AMRatingControl_Prefix.pch --- AMRatingControl_Prefix.pch | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 AMRatingControl_Prefix.pch diff --git a/AMRatingControl_Prefix.pch b/AMRatingControl_Prefix.pch deleted file mode 100644 index 1f85378..0000000 --- a/AMRatingControl_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'RatingControl' target in the 'RatingControl' project -// - -#ifdef __OBJC__ - #import - #import -#endif From 4a864aee388e1b8abb66bd9009b942e38c783c77 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:27:23 -0700 Subject: [PATCH 06/30] Delete contents.xcworkspacedata --- .../project.xcworkspace/contents.xcworkspacedata | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 AMRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/AMRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AMRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 625b4a6..0000000 --- a/AMRatingControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - From 72d43ca1db50444ea8e3557314c7bfc7925e0afa Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:27:32 -0700 Subject: [PATCH 07/30] Delete project.pbxproj --- AMRatingControl.xcodeproj/project.pbxproj | 304 ---------------------- 1 file changed, 304 deletions(-) delete mode 100755 AMRatingControl.xcodeproj/project.pbxproj diff --git a/AMRatingControl.xcodeproj/project.pbxproj b/AMRatingControl.xcodeproj/project.pbxproj deleted file mode 100755 index 9880a3a..0000000 --- a/AMRatingControl.xcodeproj/project.pbxproj +++ /dev/null @@ -1,304 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; - 758D370E112C04F6003C8E62 /* AMRatingControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 758D370D112C04F6003C8E62 /* AMRatingControl.m */; }; - 758D3711112C0881003C8E62 /* dot.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D370F112C0881003C8E62 /* dot.png */; }; - 758D3712112C0881003C8E62 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D3710112C0881003C8E62 /* star.png */; }; - C94C7B021619D449008701B7 /* AMRatingControlAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7AFD1619D449008701B7 /* AMRatingControlAppDelegate.m */; }; - C94C7B031619D449008701B7 /* AMRatingControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7B001619D449008701B7 /* AMRatingControlViewController.m */; }; - C94C7B041619D449008701B7 /* AMRatingControlViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C94C7B011619D449008701B7 /* AMRatingControlViewController.xib */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D6058910D05DD3D006BFB54 /* AMRatingControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AMRatingControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* AMRatingControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMRatingControl_Prefix.pch; sourceTree = ""; }; - 758D370C112C04F6003C8E62 /* AMRatingControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMRatingControl.h; sourceTree = ""; }; - 758D370D112C04F6003C8E62 /* AMRatingControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMRatingControl.m; sourceTree = ""; }; - 758D370F112C0881003C8E62 /* dot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot.png; sourceTree = ""; }; - 758D3710112C0881003C8E62 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* AMRatingControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "AMRatingControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - C94C7AFC1619D449008701B7 /* AMRatingControlAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMRatingControlAppDelegate.h; sourceTree = ""; }; - C94C7AFD1619D449008701B7 /* AMRatingControlAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMRatingControlAppDelegate.m; sourceTree = ""; }; - C94C7AFF1619D449008701B7 /* AMRatingControlViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMRatingControlViewController.h; sourceTree = ""; }; - C94C7B001619D449008701B7 /* AMRatingControlViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMRatingControlViewController.m; sourceTree = ""; }; - C94C7B011619D449008701B7 /* AMRatingControlViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AMRatingControlViewController.xib; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 758D370C112C04F6003C8E62 /* AMRatingControl.h */, - 758D370D112C04F6003C8E62 /* AMRatingControl.m */, - C94C7AFA1619D41D008701B7 /* Demo */, - ); - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* AMRatingControl.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* AMRatingControl_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 758D370F112C0881003C8E62 /* dot.png */, - 758D3710112C0881003C8E62 /* star.png */, - 28AD733E0D9D9553002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* AMRatingControl-Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765A40DF7441C002DB57D /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C94C7AFA1619D41D008701B7 /* Demo */ = { - isa = PBXGroup; - children = ( - C94C7AFB1619D449008701B7 /* App */, - C94C7AFE1619D449008701B7 /* Controller */, - ); - name = Demo; - path = ../Demo; - sourceTree = ""; - }; - C94C7AFB1619D449008701B7 /* App */ = { - isa = PBXGroup; - children = ( - C94C7AFC1619D449008701B7 /* AMRatingControlAppDelegate.h */, - C94C7AFD1619D449008701B7 /* AMRatingControlAppDelegate.m */, - ); - path = App; - sourceTree = ""; - }; - C94C7AFE1619D449008701B7 /* Controller */ = { - isa = PBXGroup; - children = ( - C94C7AFF1619D449008701B7 /* AMRatingControlViewController.h */, - C94C7B001619D449008701B7 /* AMRatingControlViewController.m */, - C94C7B011619D449008701B7 /* AMRatingControlViewController.xib */, - ); - path = Controller; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* AMRatingControl */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AMRatingControl" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AMRatingControl; - productName = FavStarControl; - productReference = 1D6058910D05DD3D006BFB54 /* AMRatingControl.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0450; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AMRatingControl" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* AMRatingControl */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 758D3711112C0881003C8E62 /* dot.png in Resources */, - 758D3712112C0881003C8E62 /* star.png in Resources */, - C94C7B041619D449008701B7 /* AMRatingControlViewController.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 758D370E112C04F6003C8E62 /* AMRatingControl.m in Sources */, - C94C7B021619D449008701B7 /* AMRatingControlAppDelegate.m in Sources */, - C94C7B031619D449008701B7 /* AMRatingControlViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AMRatingControl_Prefix.pch; - INFOPLIST_FILE = "AMRatingControl-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - PRODUCT_NAME = AMRatingControl; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AMRatingControl_Prefix.pch; - INFOPLIST_FILE = "AMRatingControl-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - PRODUCT_NAME = AMRatingControl; - SDKROOT = iphoneos; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - SDKROOT = iphoneos; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; - SDKROOT = iphoneos; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AMRatingControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AMRatingControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} From bb46eaa6f38417a201a693cfd1f6918b00a686e9 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:27:48 -0700 Subject: [PATCH 08/30] Delete AMRatingControlAppDelegate.h --- Demo/App/AMRatingControlAppDelegate.h | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 Demo/App/AMRatingControlAppDelegate.h diff --git a/Demo/App/AMRatingControlAppDelegate.h b/Demo/App/AMRatingControlAppDelegate.h deleted file mode 100644 index e709615..0000000 --- a/Demo/App/AMRatingControlAppDelegate.h +++ /dev/null @@ -1,21 +0,0 @@ -#import - - -@class AMRatingControlViewController; - - -@interface AMRatingControlAppDelegate : NSObject -{ - UIWindow *window; - AMRatingControlViewController *viewController; -} - - -/**************************************************************************************************/ -#pragma mark - Getters & Setters - -@property (nonatomic, strong) IBOutlet UIWindow *window; -@property (nonatomic, strong) IBOutlet AMRatingControlViewController *viewController; - - -@end From b037593771d78579deecaee3dadb0b016754b05c Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:27:56 -0700 Subject: [PATCH 09/30] Delete AMRatingControlAppDelegate.m --- Demo/App/AMRatingControlAppDelegate.m | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 Demo/App/AMRatingControlAppDelegate.m diff --git a/Demo/App/AMRatingControlAppDelegate.m b/Demo/App/AMRatingControlAppDelegate.m deleted file mode 100644 index fd3059f..0000000 --- a/Demo/App/AMRatingControlAppDelegate.m +++ /dev/null @@ -1,25 +0,0 @@ -#import "AMRatingControlAppDelegate.h" -#import "AMRatingControlViewController.h" - - -@implementation AMRatingControlAppDelegate - - -/**************************************************************************************************/ -#pragma mark - Getters & Setters - -@synthesize window; -@synthesize viewController; - - -/**************************************************************************************************/ -#pragma mark - Application Lifecycle - -- (void)applicationDidFinishLaunching:(UIApplication *)application -{ - [window addSubview:viewController.view]; - [window makeKeyAndVisible]; -} - - -@end From cd268d5f427c4f6dfd3d7170693ce0f7baef10e3 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:28:06 -0700 Subject: [PATCH 10/30] Delete AMRatingControlViewController.h --- Demo/Controller/AMRatingControlViewController.h | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 Demo/Controller/AMRatingControlViewController.h diff --git a/Demo/Controller/AMRatingControlViewController.h b/Demo/Controller/AMRatingControlViewController.h deleted file mode 100644 index 05dbe52..0000000 --- a/Demo/Controller/AMRatingControlViewController.h +++ /dev/null @@ -1,10 +0,0 @@ -#import - -@interface AMRatingControlViewController : UIViewController -{ - IBOutlet UILabel *label; - IBOutlet UILabel *endLabel; -} - -@end - From 70bcccc35a8989424a08ac86ac932641a4b30309 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:28:18 -0700 Subject: [PATCH 11/30] Delete AMRatingControlViewController.m --- .../AMRatingControlViewController.m | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 Demo/Controller/AMRatingControlViewController.m diff --git a/Demo/Controller/AMRatingControlViewController.m b/Demo/Controller/AMRatingControlViewController.m deleted file mode 100644 index 5800857..0000000 --- a/Demo/Controller/AMRatingControlViewController.m +++ /dev/null @@ -1,76 +0,0 @@ -#import "AMRatingControlViewController.h" -#import "AMRatingControl.h" - - -@interface AMRatingControlViewController (Private) - -- (void)updateRating:(id)sender; -- (void)updateEndRating:(id)sender; - -@end - - -@implementation AMRatingControlViewController - - -/**************************************************************************************************/ -#pragma mark - View Lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - // 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:CGPointMake(90, 50) - andMaxRating:5]; - - // Customize the current rating if needed - [simpleRatingControl setRating:3]; - [simpleRatingControl setStarSpacing:10]; - - // 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 - UIImage *dot, *star; - dot = [UIImage imageNamed:@"dot.png"]; - star = [UIImage imageNamed:@"star.png"]; - AMRatingControl *imagesRatingControl = [[AMRatingControl alloc] initWithLocation:CGPointMake(110, 250) - emptyImage:dot - solidImage:star - andMaxRating:5]; - - // Create an instance with custom color, 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:CGPointMake(110, 370) - emptyColor:[UIColor yellowColor] - solidColor:[UIColor redColor] - andMaxRating:5]; - - - - - // Add the control(s) as a subview of your view - [self.view addSubview:simpleRatingControl]; - [self.view addSubview:imagesRatingControl]; - [self.view addSubview:coloredRatingControl]; -} - - -@end From d67d33f548d9cd36ea960b65025ba0041500b038 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:28:28 -0700 Subject: [PATCH 12/30] Delete AMRatingControlViewController.xib --- .../AMRatingControlViewController.xib | 428 ------------------ 1 file changed, 428 deletions(-) delete mode 100644 Demo/Controller/AMRatingControlViewController.xib diff --git a/Demo/Controller/AMRatingControlViewController.xib b/Demo/Controller/AMRatingControlViewController.xib deleted file mode 100644 index 6db710b..0000000 --- a/Demo/Controller/AMRatingControlViewController.xib +++ /dev/null @@ -1,428 +0,0 @@ - - - - 784 - 11G63 - 3084 - 1138.51 - 569.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - YES - IBProxyObject - IBUILabel - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 292 - {{146, 96}, {154, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Label - - 1 - MCAwIDAAA - - - 1 - 10 - 1 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 292 - {{20, 125}, {110, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - End rating - - 1 - MCAwIDAAA - darkTextColor - - - 0 - - - NO - - - - 292 - {{20, 96}, {118, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Rating change - - - 0 - - - NO - - - - 292 - {{146, 125}, {154, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Label - - - 0 - 1 - - - NO - - - - 292 - {{20, 20}, {251, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Simple Rating Control (10px Space) - - - 0 - 9 - - - - - - 292 - {{20, 219}, {271, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Imaged Rating Control - - - 0 - - - NO - - - - 292 - {{20, 339}, {280, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Colored Rating Control - - - 0 - - - NO - - - {{0, 20}, {320, 460}} - - - - - 3 - MC43NQA - - 2 - - - NO - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 7 - - - - label - - - - 9 - - - - endLabel - - - - 13 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 6 - - - YES - - - - - - - - - - - - 8 - - - - - 10 - - - - - 11 - - - - - 12 - - - - - 14 - - - - - 15 - - - - - 17 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 10.IBPluginDependency - 11.IBPluginDependency - 12.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 17.IBPluginDependency - 6.IBPluginDependency - 8.IBPluginDependency - - - YES - AMRatingControlViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 17 - - - - YES - - AMRatingControlViewController - UIViewController - - YES - - YES - endLabel - label - - - YES - UILabel - UILabel - - - - YES - - YES - endLabel - label - - - YES - - endLabel - UILabel - - - label - UILabel - - - - - IBProjectSource - ./Classes/AMRatingControlViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 2083 - - From b4c8ab061314b3f03adfbee1bd85140b24aec10d Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:28:40 -0700 Subject: [PATCH 13/30] Delete AMRatingControl.h --- Classes/AMRatingControl.h | 62 --------------------------------------- 1 file changed, 62 deletions(-) delete mode 100755 Classes/AMRatingControl.h diff --git a/Classes/AMRatingControl.h b/Classes/AMRatingControl.h deleted file mode 100755 index ba286d3..0000000 --- a/Classes/AMRatingControl.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// AMRatingControl.h -// RatingControl -// - - -#import - -typedef void (^EditingChangedBlock)(NSUInteger rating); -typedef void (^EditingDidEndBlock)(NSUInteger rating); - - -@interface AMRatingControl : UIControl - - -/**************************************************************************************************/ -#pragma mark - Getters and Setters - -@property (nonatomic, assign) NSInteger maxRating; -@property (nonatomic, assign) NSInteger rating; -@property (nonatomic, readwrite) NSUInteger starFontSize; -@property (nonatomic, readwrite) NSUInteger starWidthAndHeight; -@property (nonatomic, readwrite) NSUInteger starSpacing; -@property (nonatomic, copy) EditingChangedBlock editingChangedBlock; -@property (nonatomic, copy) EditingDidEndBlock editingDidEndBlock; - -/**************************************************************************************************/ -#pragma mark - Birth & Death - -/** - * @param location : position of the rating control in your view - * The control will manage its own width/height (kind of like UIActivityIndicator) - * @param maxRating - */ -- (id)initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating; - -/** - * @param location : position of the rating control in your view - * The control will manage its own width/height (kind of like UIActivityIndicator) - * @param emptyColor & solidColor - * @param maxRating - */ -- (id)initWithLocation:(CGPoint)location - emptyColor:(UIColor *)emptyColor - solidColor:(UIColor *)solidColor - andMaxRating:(NSInteger)maxRating; - -/** - * @param location : position of the rating control in your view - * The control will manage its own width/height (kind of like UIActivityIndicator) - * @param emptyImage & solidImage can both be nil, or not even a dot or a star (a any images you want!) - * If either of these parameters are nil, the class will draw its own stars - * @param maxRating - */ -- (id)initWithLocation:(CGPoint)location - emptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil - andMaxRating:(NSInteger)maxRating; - - - -@end From bb8630958c06f3c2518a9fe79889f26f5578ba30 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:28:48 -0700 Subject: [PATCH 14/30] Delete AMRatingControl.m --- Classes/AMRatingControl.m | 325 -------------------------------------- 1 file changed, 325 deletions(-) delete mode 100755 Classes/AMRatingControl.m diff --git a/Classes/AMRatingControl.m b/Classes/AMRatingControl.m deleted file mode 100755 index a26ef58..0000000 --- a/Classes/AMRatingControl.m +++ /dev/null @@ -1,325 +0,0 @@ -// -// AMRatingControl.m -// RatingControl -// - - -#import "AMRatingControl.h" - - -// Constants : -static const CGFloat kFontSize = 20; -static const NSInteger kStarWidthAndHeight = 20; -static const NSInteger kStarSpacing = 0; - -static const NSString *kDefaultEmptyChar = @"☆"; -static const NSString *kDefaultSolidChar = @"★"; - - -@interface AMRatingControl (Private) - -- (id)initWithLocation:(CGPoint)location - emptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil - emptyColor:(UIColor *)emptyColor - solidColor:(UIColor *)solidColor - andMaxRating:(NSInteger)maxRating; - -- (void)adjustFrame; -- (void)handleTouch:(UITouch *)touch; - -@end - - -@implementation AMRatingControl -{ - BOOL _respondsToTranslatesAutoresizingMaskIntoConstraints; - UIImage *_emptyImage, *_solidImage; - UIColor *_emptyColor, *_solidColor; - NSInteger _maxRating; -} - -/**************************************************************************************************/ -#pragma mark - Getters & Setters - -- (void)setMaxRating:(NSInteger)maxRating -{ - _maxRating = maxRating; - if (_rating > maxRating) { - _rating = maxRating; - } - [self adjustFrame]; - [self setNeedsDisplay]; -} - -- (void)setRating:(NSInteger)rating -{ - _rating = (rating < 0) ? 0 : rating; - _rating = (rating > _maxRating) ? _maxRating : rating; - [self setNeedsDisplay]; -} - -- (void)setStarWidthAndHeight:(NSUInteger)starWidthAndHeight -{ - _starWidthAndHeight = starWidthAndHeight; - [self adjustFrame]; - [self setNeedsDisplay]; -} - -- (void)setStarSpacing:(NSUInteger)starSpacing -{ - _starSpacing = starSpacing; - [self adjustFrame]; - [self setNeedsDisplay]; -} - -/**************************************************************************************************/ -#pragma mark - Birth & Death - -- (id)initWithLocation:(CGPoint)location andMaxRating:(NSInteger)maxRating -{ - return [self initWithLocation:location - emptyImage:nil - solidImage:nil - emptyColor:nil - solidColor:nil - andMaxRating:maxRating]; -} - -- (id)initWithLocation:(CGPoint)location - emptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil - andMaxRating:(NSInteger)maxRating -{ - return [self initWithLocation:location - emptyImage:emptyImageOrNil - solidImage:solidImageOrNil - emptyColor:nil - solidColor:nil - andMaxRating:maxRating]; -} - -- (id)initWithLocation:(CGPoint)location - emptyColor:(UIColor *)emptyColor - solidColor:(UIColor *)solidColor - andMaxRating:(NSInteger)maxRating -{ - return [self initWithLocation:location - emptyImage:nil - solidImage:nil - emptyColor:emptyColor - solidColor:solidColor - andMaxRating:maxRating]; -} - -- (void)dealloc -{ - _emptyImage = nil, - _solidImage = nil; - _emptyColor = nil; - _solidColor = nil; -} - -/**************************************************************************************************/ -#pragma mark - Auto Layout - -- (CGSize)intrinsicContentSize -{ - return CGSizeMake(_maxRating * _starWidthAndHeight + (_maxRating - 1) * _starSpacing, - _starWidthAndHeight); -} - - -/**************************************************************************************************/ -#pragma mark - View Lifecycle - -- (void)drawRect:(CGRect)rect -{ - CGPoint currPoint = CGPointZero; - - for (int i = 0; i < _rating; i++) - { - if (_solidImage) - { - [_solidImage drawAtPoint:currPoint]; - } - else - { - CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), _solidColor.CGColor); - [kDefaultSolidChar drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_starFontSize]]; - } - - currPoint.x += (_starWidthAndHeight + _starSpacing); - } - - NSInteger remaining = _maxRating - _rating; - - for (int i = 0; i < remaining; i++) - { - if (_emptyImage) - { - [_emptyImage drawAtPoint:currPoint]; - } - else - { - CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), _emptyColor.CGColor); - [kDefaultEmptyChar drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_starFontSize]]; - } - currPoint.x += (_starWidthAndHeight + _starSpacing); - } -} - - -/**************************************************************************************************/ -#pragma mark - UIControl - -- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - [self handleTouch:touch]; - return YES; -} - -- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - [self handleTouch:touch]; - return YES; -} - -- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - if (self.editingDidEndBlock) - { - self.editingDidEndBlock(_rating); - } -} - - -/**************************************************************************************************/ -#pragma mark - Private Methods - -- (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil - emptyColor:(UIColor *)emptyColor - solidColor:(UIColor *)solidColor - andMaxRating:(NSInteger)maxRating -{ - _respondsToTranslatesAutoresizingMaskIntoConstraints = [self respondsToSelector:@selector(translatesAutoresizingMaskIntoConstraints)]; - - _rating = 0; - self.backgroundColor = [UIColor clearColor]; - self.opaque = NO; - - _emptyImage = emptyImageOrNil; - _solidImage = solidImageOrNil; - _emptyColor = emptyColor; - _solidColor = solidColor; - _maxRating = maxRating; - _starFontSize = kFontSize; - _starWidthAndHeight = kStarWidthAndHeight; - _starSpacing = kStarSpacing; -} - -- (id)initWithCoder:(NSCoder *)decoder -{ - self = [super initWithCoder:decoder]; - if (self) { - [self initializeWithEmptyImage:nil - solidImage:nil - emptyColor:nil - solidColor:nil - andMaxRating:0]; - } - return self; -} - - -- (id)initWithLocation:(CGPoint)location - emptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil - emptyColor:(UIColor *)emptyColor - solidColor:(UIColor *)solidColor - andMaxRating:(NSInteger)maxRating -{ - if (self = [self initWithFrame:CGRectMake(location.x, - location.y, - (maxRating * kStarWidthAndHeight), - kStarWidthAndHeight)]) - { - [self initializeWithEmptyImage:emptyImageOrNil - solidImage:solidImageOrNil - emptyColor:emptyColor - solidColor:solidColor - andMaxRating:maxRating]; - } - - return self; -} - -- (void)adjustFrame -{ - if (_respondsToTranslatesAutoresizingMaskIntoConstraints && !self.translatesAutoresizingMaskIntoConstraints) - { - [self invalidateIntrinsicContentSize]; - } - else - { - CGRect newFrame = CGRectMake(self.frame.origin.x, - self.frame.origin.y, - _maxRating * _starWidthAndHeight + (_maxRating - 1) * _starSpacing, - _starWidthAndHeight); - self.frame = newFrame; - } -} - -- (void)handleTouch:(UITouch *)touch -{ - CGFloat width = self.frame.size.width; - CGRect section = CGRectMake(0, 0, _starWidthAndHeight, self.frame.size.height); - - CGPoint touchLocation = [touch locationInView:self]; - - if (touchLocation.x < 0) - { - if (_rating != 0) - { - _rating = 0; - if (self.editingChangedBlock) - { - self.editingChangedBlock(_rating); - } - } - } - else if (touchLocation.x > width) - { - if (_rating != _maxRating) - { - _rating = _maxRating; - if (self.editingChangedBlock) - { - self.editingChangedBlock(_rating); - } - } - } - else - { - for (int i = 0 ; i < _maxRating ; i++) - { - if ((touchLocation.x > section.origin.x) && (touchLocation.x < (section.origin.x + _starWidthAndHeight))) - { - if (_rating != (i + 1)) - { - _rating = i + 1; - if (self.editingChangedBlock) - { - self.editingChangedBlock(_rating); - } - } - break; - } - section.origin.x += (_starWidthAndHeight + _starSpacing); - } - } - [self setNeedsDisplay]; -} - -@end From 591f6b513f8539174bc21bf8db205114a8b7c377 Mon Sep 17 00:00:00 2001 From: xeniah Date: Mon, 24 Mar 2014 16:32:11 -0700 Subject: [PATCH 15/30] Update README.mdown Erased the CocoaPods instructions - did not make this into a pod just yet --- README.mdown | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.mdown b/README.mdown index 050da0e..dda5a74 100755 --- a/README.mdown +++ b/README.mdown @@ -11,14 +11,6 @@ You can use default star symbols and customize colors or specify custom images. ## How To Get Started -**- Using [CocoaPods](http://cocoapods.org/)** - -``` ruby -pod 'StarRatingControl' -``` - -**- Without CocoaPods** - Add `StarRatingControl.h` and `StarRatingControl.m` to your project. From c08bf2ea4f309f075b29aad802768ca6e7ea233e Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 11:26:50 -0700 Subject: [PATCH 16/30] for half ratings, have a option for 'half filled star' image --- Classes/StarRatingControl.h | 1 + Classes/StarRatingControl.m | 35 +++++++++++++++++- .../StarRatingControlViewController.m | 11 ++++-- StarRatingControl.xcodeproj/project.pbxproj | 24 ++++++++++++ empty_star.png | Bin 0 -> 1146 bytes empty_star@2x.png | Bin 0 -> 1436 bytes full_star.png | Bin 0 -> 1101 bytes full_star@2x.png | Bin 0 -> 1282 bytes half_star.png | Bin 0 -> 1127 bytes half_star@2x.png | Bin 0 -> 1377 bytes 10 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 empty_star.png create mode 100644 empty_star@2x.png create mode 100644 full_star.png create mode 100644 full_star@2x.png create mode 100644 half_star.png create mode 100644 half_star@2x.png diff --git a/Classes/StarRatingControl.h b/Classes/StarRatingControl.h index dc288de..d026c65 100755 --- a/Classes/StarRatingControl.h +++ b/Classes/StarRatingControl.h @@ -72,6 +72,7 @@ typedef void (^EditingDidEndBlock)(NSUInteger rating); - (id)initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil + halfImage:(UIImage *)halfFillerImageOrNil userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating; diff --git a/Classes/StarRatingControl.m b/Classes/StarRatingControl.m index f756483..1d68c8e 100755 --- a/Classes/StarRatingControl.m +++ b/Classes/StarRatingControl.m @@ -34,7 +34,7 @@ - (void)handleTouch:(UITouch *)touch; @implementation StarRatingControl { BOOL _respondsToTranslatesAutoresizingMaskIntoConstraints; - UIImage *_emptyImage, *_solidImage; + UIImage *_emptyImage, *_solidImage, *_halfFilledImage; UIColor *_emptyColor, *_solidColor; NSInteger _maxRating; } @@ -105,10 +105,29 @@ - (id)initWithLocation:(CGPoint)location userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating +{ + return [self initWithLocation:location + emptyImage:emptyImageOrNil + solidImage:solidImageOrNil + halfImage:nil + userInteractionEnabled:userInteractionEnabled + initialRating:initialRating + andMaxRating:maxRating]; +} + + +- (id)initWithLocation:(CGPoint)location + emptyImage:(UIImage *)emptyImageOrNil + solidImage:(UIImage *)solidImageOrNil + halfImage:(UIImage *)halfFillerImageOrNil +userInteractionEnabled:(BOOL)userInteractionEnabled + initialRating:(float)initialRating + andMaxRating:(NSInteger)maxRating { return [self initWithLocation:location emptyImage:emptyImageOrNil solidImage:solidImageOrNil + halfImage:halfFillerImageOrNil emptyColor:nil solidColor:nil userInteractionEnabled:userInteractionEnabled @@ -116,6 +135,7 @@ - (id)initWithLocation:(CGPoint)location andMaxRating:maxRating]; } + - (id)initWithLocation:(CGPoint)location emptyColor:(UIColor *)emptyColor solidColor:(UIColor *)solidColor @@ -170,7 +190,11 @@ - (void)drawRect:(CGRect)rect } if (_partialRating > 0.0) { - UIImage *partialStar = [self partialImage:_solidImage fraction:_partialRating]; + UIImage *partialStar = _halfFilledImage; + if (!partialStar) { + partialStar = [self partialImage:_solidImage fraction:_partialRating]; + } + [partialStar drawAtPoint:currPoint]; currPoint.x += (_starWidthAndHeight + _starSpacing); } @@ -229,6 +253,7 @@ - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil + halfFilledImage:nil emptyColor:emptyColor solidColor:solidColor userInteractionEnabled:YES @@ -238,6 +263,7 @@ - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil + halfFilledImage:(UIImage *)halfFilledImageOrNil emptyColor:(UIColor *)emptyColor solidColor:(UIColor *)solidColor userInteractionEnabled:(BOOL)userInteractionEnabled @@ -252,6 +278,7 @@ - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil _emptyImage = emptyImageOrNil; _solidImage = solidImageOrNil; + _halfFilledImage = halfFilledImageOrNil; _emptyColor = emptyColor; _solidColor = solidColor; _maxRating = maxRating; @@ -269,6 +296,7 @@ - (id)initWithCoder:(NSCoder *)decoder if (self) { [self initializeWithEmptyImage:nil solidImage:nil + halfFilledImage:nil emptyColor:nil solidColor:nil userInteractionEnabled:YES @@ -282,6 +310,7 @@ - (id)initWithCoder:(NSCoder *)decoder - (id)initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil + halfImage:(UIImage *)halfFillerImageOrNil emptyColor:(UIColor *)emptyColor solidColor:(UIColor *)solidColor userInteractionEnabled:(BOOL)userInteractionEnabled @@ -295,6 +324,7 @@ - (id)initWithLocation:(CGPoint)location { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil + halfFilledImage:halfFillerImageOrNil emptyColor:emptyColor solidColor:solidColor userInteractionEnabled:(BOOL)userInteractionEnabled @@ -319,6 +349,7 @@ - (id)initWithLocation:(CGPoint)location { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil + halfFilledImage:nil emptyColor:emptyColor solidColor:solidColor userInteractionEnabled:YES diff --git a/Demo/Controller/StarRatingControlViewController.m b/Demo/Controller/StarRatingControlViewController.m index ebcd703..9d64842 100755 --- a/Demo/Controller/StarRatingControlViewController.m +++ b/Demo/Controller/StarRatingControlViewController.m @@ -46,12 +46,15 @@ - (void)viewDidLoad // - 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 - UIImage *dot, *star; - dot = [UIImage imageNamed:@"dot.png"]; - star = [UIImage imageNamed:@"star.png"]; + UIImage *dot, *star, *halfStar; + dot = [UIImage imageNamed:@"empty_star.png"]; + star = [UIImage imageNamed:@"full_star.png"]; + halfStar= [UIImage imageNamed:@"half_star.png"]; + StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 250) - emptyImage:nil + emptyImage:dot solidImage:star + halfImage:halfStar userInteractionEnabled:NO initialRating:3.6 andMaxRating:5]; diff --git a/StarRatingControl.xcodeproj/project.pbxproj b/StarRatingControl.xcodeproj/project.pbxproj index 46ac5b4..07b6163 100755 --- a/StarRatingControl.xcodeproj/project.pbxproj +++ b/StarRatingControl.xcodeproj/project.pbxproj @@ -15,6 +15,12 @@ 758D370E112C04F6003C8E62 /* StarRatingControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 758D370D112C04F6003C8E62 /* StarRatingControl.m */; }; 758D3711112C0881003C8E62 /* dot.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D370F112C0881003C8E62 /* dot.png */; }; 758D3712112C0881003C8E62 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D3710112C0881003C8E62 /* star.png */; }; + A9542A9918E1FAF300145FB6 /* empty_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9318E1FAF300145FB6 /* empty_star.png */; }; + A9542A9A18E1FAF300145FB6 /* empty_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9418E1FAF300145FB6 /* empty_star@2x.png */; }; + A9542A9B18E1FAF300145FB6 /* full_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9518E1FAF300145FB6 /* full_star.png */; }; + A9542A9C18E1FAF300145FB6 /* full_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9618E1FAF300145FB6 /* full_star@2x.png */; }; + A9542A9D18E1FAF300145FB6 /* half_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9718E1FAF300145FB6 /* half_star.png */; }; + A9542A9E18E1FAF300145FB6 /* half_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9818E1FAF300145FB6 /* half_star@2x.png */; }; C94C7B021619D449008701B7 /* StarRatingControlAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */; }; C94C7B031619D449008701B7 /* StarRatingControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7B001619D449008701B7 /* StarRatingControlViewController.m */; }; C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C94C7B011619D449008701B7 /* StarRatingControlViewController.xib */; }; @@ -33,6 +39,12 @@ 758D370F112C0881003C8E62 /* dot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot.png; sourceTree = ""; }; 758D3710112C0881003C8E62 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = ""; }; 8D1107310486CEB800E47090 /* StarRatingControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "StarRatingControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + A9542A9318E1FAF300145FB6 /* empty_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = empty_star.png; sourceTree = ""; }; + A9542A9418E1FAF300145FB6 /* empty_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "empty_star@2x.png"; sourceTree = ""; }; + A9542A9518E1FAF300145FB6 /* full_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = full_star.png; sourceTree = ""; }; + A9542A9618E1FAF300145FB6 /* full_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "full_star@2x.png"; sourceTree = ""; }; + A9542A9718E1FAF300145FB6 /* half_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = half_star.png; sourceTree = ""; }; + A9542A9818E1FAF300145FB6 /* half_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "half_star@2x.png"; sourceTree = ""; }; C94C7AFC1619D449008701B7 /* StarRatingControlAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlAppDelegate.h; sourceTree = ""; }; C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControlAppDelegate.m; sourceTree = ""; }; C94C7AFF1619D449008701B7 /* StarRatingControlViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlViewController.h; sourceTree = ""; }; @@ -96,6 +108,12 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + A9542A9318E1FAF300145FB6 /* empty_star.png */, + A9542A9418E1FAF300145FB6 /* empty_star@2x.png */, + A9542A9518E1FAF300145FB6 /* full_star.png */, + A9542A9618E1FAF300145FB6 /* full_star@2x.png */, + A9542A9718E1FAF300145FB6 /* half_star.png */, + A9542A9818E1FAF300145FB6 /* half_star@2x.png */, 758D370F112C0881003C8E62 /* dot.png */, 758D3710112C0881003C8E62 /* star.png */, 28AD733E0D9D9553002E5188 /* MainWindow.xib */, @@ -195,9 +213,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A9542A9D18E1FAF300145FB6 /* half_star.png in Resources */, + A9542A9B18E1FAF300145FB6 /* full_star.png in Resources */, + A9542A9C18E1FAF300145FB6 /* full_star@2x.png in Resources */, 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 758D3711112C0881003C8E62 /* dot.png in Resources */, + A9542A9E18E1FAF300145FB6 /* half_star@2x.png in Resources */, 758D3712112C0881003C8E62 /* star.png in Resources */, + A9542A9918E1FAF300145FB6 /* empty_star.png in Resources */, + A9542A9A18E1FAF300145FB6 /* empty_star@2x.png in Resources */, C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/empty_star.png b/empty_star.png new file mode 100644 index 0000000000000000000000000000000000000000..a4adfd5837d5fe28408ecebd39199f6a81ce49f9 GIT binary patch literal 1146 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CN!3HF~3v%Ltlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6H#24v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`GuBNuFf>#!Gt)CP zF*P$Y)KM@pFf`IP03tJ8LlY}gGbUo-h6WQb!1OB;3-k^33_xCjDfIQluQWFouDZA+C>7yetOgf{R2HP_ z2c;J0mlh=hBQ8xDWL1Hcb5UwyNq$jCetr%t6azByOY(~|@(UE4gUu8)!ZY(y^2>`g z!Rmc|tvvIJOA_;vQ$1a5m4GJbWoD*W8JoBmyEz&fIhmLk8ydPATN*f9IGI?O7@9db zn>ac-!t}c2Czs}?=9R$orXchhv@OxDQ@3}*nd#5+$H$B>F! zITLNU9TP>4zdzdGv#(*g)A9jLdR>0uU-43lgp;KF41V7elpF0ZRzXs zFL!p?z6;)8eQxjb`g`-TBc`Rku$i?{N91nOGMhQiZ+6X|q1vJ-`by^hxgE!U*sI<+ z%#v00;dHwdg+Gf6jR~y25B$AgN>rPlTVamq@El$TdhB*Re zF>X_iC?3;3Dd(a;XHJi^!h5B4x01G8%g>y8CG_oA<@;?))5Pa1PiSBk74|BbUi*M2 z@W!j_THdS)Y~nvo#1({cw%v1#I=3+Czs|0&2B|yiqQ8hHFmUH(?OsDSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCJdP6mkoIHoK%2WtOF;xE1B+DuBIgm5JLe#yHJ` z>P^Az789I$^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5?;%{gPo|U=r|jaSW-r zwPvcXM@XQ^@wox!y;c!v3NOxdh$UKT-<`5xi}9uyj;!1g!90d*pLkHva!Prq6pmaOp0UzWYMQU3Y9-yiLt->E(?+n*X4xorPm z^@CbIz2zE4$-AD#T)SDf*q}vu{cApfz1=%`r$5~I(yITYnBu(V$X2emRujykzusNT zvn%wE@t(%dAFfR0>Db4ynbB^?`rMPxBvzeFdRuQS5%TeSM{U4C%@b{jOeajwHJoJh zIdQCXg5As#=8vLt!y6)-g3hWeiu5ddt>9RbTz5uTn&ZpoLU-0$KF2f8;X!xAd{m#Y znxuFn_{ga6uV-1bfrI;l=rqATsXH4KVw$xta8G}ryG3nVhi93({6f};KO(gPjDIDG zyFb<_JYiyHdNnqq>AKX-{axETf2@plX_pDud$)7pj*fFnJC4h)UuiYbXNlAMjXN$L zaAy}eygQ`uxK)Cagz>uh=Dad@f~+5xdSaL!#d$1>lxP{oRcrCaV~nBw$R6TV*Pfzij|KU zFCW*FtXm#Um^_h1_Lr_SbbM=AbF#Un z^1;7n4s!M@A91SvH_|byRFOZZeeKPS<8|By46n?O_ZaS5u@zKadb;|#taD0e0syDw B6wm+w literal 0 HcmV?d00001 diff --git a/full_star.png b/full_star.png new file mode 100644 index 0000000000000000000000000000000000000000..a1783210d37c3f7fb400a769c704c48a6f570d11 GIT binary patch literal 1101 zcmaJ=TWHfz7*1E&t=pJWygqoyM5e4w(@VC7)m@rS>uf1q!QmX5CTDHzl9MH8Hk*Q* zC`^5ss1LqPaNvuI;DaD2LSKAZ5g&#Ris-92eHwT@nQQgI8j_p~-}n9h`Ty@+P9_dD zH|}brD5^PjSV)nviF~g5TJj&#Cr*-KCytKbVKj~lq5-LX8D$`dsbUtUpeRpIzJNUx z<)oGL2p)+auF=RGqLXs;Ae|MJW$4$iS?kh3QXEp3y*&!}PIW+#A;;FsB@z zG2rk_A}!72rI1Yb9t1rWPXttmMPR8Dn#o&XdR><%b9K-&<9tdO+=xY1VLFGg&NED* zQ1BG|9%N)0HWUik8a|(!Al&A(hDFP*neAl-0h*Gb=vYA-uocA&n!;h4WcvFEs$P-R z%#AXUf-#n;GpxsJAE^wC$Nvvi)e73gDflPfe+rxFX&o{tXrd`YB8?kww?pZC#DF43 zMjD}saut&~gprv;I*1H&pyQaL$*5rNU&qJed`vU3s7Wv;glVGSQ52c?`Gb*Amp?QR z2>4kx>L1`(Z`9Wv9qk}+buEg`0(4V$m zXV!lH>~-=#PAugbisH(L9sQepYpHw1`a6l5hpnyo&yU`Gz0|o}oNdU=t!$mYIoItP zYnyPE(k)=LZoYZ;v15Me_7^nwc=!AR=jR}Jx?GR*dls&_ik(dtpYL6`etLF|+I%Hj zGwIk;8h$(5bRN7J>YLn`{CM8#aD0DPbLY(a(qdiu+|KZgSF0JkzR8~ke-aWqkx_!Z8(S&e+;M9d**oI*1 literal 0 HcmV?d00001 diff --git a/full_star@2x.png b/full_star@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8d38f95deec7881c4439478c2f1d46805db60024 GIT binary patch literal 1282 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCv@ozVa4~Xo zHg+>Ngz0t3PcF?(%`1WFO+n~2!KoLN6mkoIHoK%2WtOF;xE1B+DuBIgm5JLehB(cG z>P^Az79*T`^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5;`|E4UdL7|T3e978H@ zCH?vT-=2Bn1MjVq_$C-V&fII>A7Sgmv!t<3A&)ich;u1-L)$M#O>u>343C78z8VS% zyEq(@m!qa$ zwHI2B76>FTKGIvje52zVW57nG2}TZwb~&u^IKZed|4#EU!4u1`H%dHNE$wi>HtkQ$ z(g>a>KOA^P5*Fyq;NV*1dx2xgwujk`JEm~H=)LXGrYvB;bkoC$4x8(nl_j$}g$3*v zPkI=ra5ykXFyMjM74`Eg5`O5fIVqCGc|!gCNrM{MT@NEZGX@;=RWR-3;eNJIx=(+x z=H$diCQZx8HuJ|U zg@4{B*d>mdUSL1zki{oZ&+usF0ufe|FQR>mWKuHh1e(8mU^0|n(V(2dxZ(rz)r89p sUG{>JbDK_WEK!K#yYiVMl273P!_(M$6JO2x5>Tn+>FVdQ&MBb@04Vgc1^@s6 literal 0 HcmV?d00001 diff --git a/half_star.png b/half_star.png new file mode 100644 index 0000000000000000000000000000000000000000..212214e142740566b6c2a3e81c348ac6bb92ea0e GIT binary patch literal 1127 zcmaJ=TWHfz7!D5RZ3U5`%y~IR1#eB7wyA4aH`=D1RWoW==uo_5$>|o>-p3%TmF0rLprhgSx(UKZVreGUkO3S;xdnCL5KS`ueFWVc zlQrzoGLeF@1=(ad#^W5R2$ZD%Lv?)&ZQ~UDlkY!;?R2LJ*%Y)7eOd)DP z86zu=P_9_TWE;ZBZbK%BHU+@KjAp1PZ!a3bOOlWFAren4xi!tLvgSg!ywr(95c5c?&gcwd2 z`tb|*;%%?Ui58+zorGo@O5&+h>&@4nJ+Vu|}fz)DLvWPRs#&Ksi70 z`kf`!>bmi>vwiR0oLZY%@#*N-kMFA&FX(#PbL+!#S8m$b>SqgIeH&Uo{TbRfdfl+EbhqFdsOx1YxWnJd9^n?|6rsyzVpDb85g@Rox3mpEbBkgu=M5Bt$oSL zpFC&uHdMS`va2q^f1kDG!tT@kxjTn`%$a-s{F5!J{(SKB(1Xgs;Y`hNdor_sVAD3& hy1@$i-B8a>s*DncVlN-nEvR>{ej?T=UWsh%{sr8EdszSg literal 0 HcmV?d00001 diff --git a/half_star@2x.png b/half_star@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..afd1f57775efab301821e35afe474171858f361a GIT binary patch literal 1377 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCP^Az79*T`^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5-?rGF~$TFnepg$%H#6u5gtGF#gm^v6Q)SgSFD8Rp{)K zsLi{YxX=C&x}E;Ja#7Cg>1-TU%Dv`C8rhT?bsQ(R|7@C)A-Ku+NU}_Mi)H(OV8*^IaLYwdZ&KjsPc?{d|7^ZzL4 zBc&=4<$uqre6M;+*Zll&k-c?;sP?;GvI!ebmpnM^*nDpF#z%4TQ7ie`x5rgKvefvt zqEh+BGQLZX?z;7N@IT~HFN*tI@K~GKtj)$~_r=!{yvhaqZ+}J4% Date: Tue, 25 Mar 2014 20:42:24 -0700 Subject: [PATCH 17/30] added different default star images. Simplified sigs of the piublic init methods --- Classes/StarRatingControl.h | 6 +- Classes/StarRatingControl.m | 128 +++++++++--------- .../StarRatingControlViewController.m | 20 ++- StarRatingControl.xcodeproj/project.pbxproj | 36 ++--- star_rating_empty.png | Bin 0 -> 1944 bytes star_rating_full.png | Bin 0 -> 1812 bytes 6 files changed, 81 insertions(+), 109 deletions(-) create mode 100644 star_rating_empty.png create mode 100644 star_rating_full.png diff --git a/Classes/StarRatingControl.h b/Classes/StarRatingControl.h index d026c65..68de197 100755 --- a/Classes/StarRatingControl.h +++ b/Classes/StarRatingControl.h @@ -17,9 +17,7 @@ typedef void (^EditingDidEndBlock)(NSUInteger rating); #pragma mark - Getters and Setters @property (nonatomic, assign) NSInteger maxRating; -@property (nonatomic, assign) NSInteger rating; -@property (nonatomic, assign) float partialRating; -//@property (nonatomic, assign) BOOL ; +@property (nonatomic, assign) float rating; @property (nonatomic, readwrite) NSUInteger starFontSize; @property (nonatomic, readwrite) NSUInteger starWidthAndHeight; @property (nonatomic, readwrite) NSUInteger starSpacing; @@ -72,8 +70,6 @@ typedef void (^EditingDidEndBlock)(NSUInteger rating); - (id)initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil - halfImage:(UIImage *)halfFillerImageOrNil -userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating; diff --git a/Classes/StarRatingControl.m b/Classes/StarRatingControl.m index 1d68c8e..8acf235 100755 --- a/Classes/StarRatingControl.m +++ b/Classes/StarRatingControl.m @@ -9,13 +9,12 @@ // Constants : static const CGFloat kFontSize = 20; -static const NSInteger kStarWidthAndHeight = 20; +static const NSInteger kStarWidthAndHeight = 27; static const NSInteger kStarSpacing = 0; static const NSString *kDefaultEmptyChar = @"☆"; static const NSString *kDefaultSolidChar = @"★"; - @interface StarRatingControl (Private) - (id)initWithLocation:(CGPoint)location @@ -34,9 +33,10 @@ - (void)handleTouch:(UITouch *)touch; @implementation StarRatingControl { BOOL _respondsToTranslatesAutoresizingMaskIntoConstraints; - UIImage *_emptyImage, *_solidImage, *_halfFilledImage; + UIImage *_emptyImage, *_solidImage; UIColor *_emptyColor, *_solidColor; NSInteger _maxRating; + BOOL _partialStarsAllowed; } /**************************************************************************************************/ @@ -52,7 +52,7 @@ - (void)setMaxRating:(NSInteger)maxRating [self setNeedsDisplay]; } -- (void)setRating:(NSInteger)rating +- (void)setRating:(float)rating { _rating = (rating < 0) ? 0 : rating; _rating = (rating > _maxRating) ? _maxRating : rating; @@ -99,38 +99,18 @@ - (id)initWithLocation:(CGPoint)location andMaxRating:maxRating]; } -- (id)initWithLocation:(CGPoint)location - emptyImage:(UIImage *)emptyImageOrNil - solidImage:(UIImage *)solidImageOrNil -userInteractionEnabled:(BOOL)userInteractionEnabled - initialRating:(float)initialRating - andMaxRating:(NSInteger)maxRating -{ - return [self initWithLocation:location - emptyImage:emptyImageOrNil - solidImage:solidImageOrNil - halfImage:nil - userInteractionEnabled:userInteractionEnabled - initialRating:initialRating - andMaxRating:maxRating]; -} - - (id)initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil - halfImage:(UIImage *)halfFillerImageOrNil -userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating { - return [self initWithLocation:location + return [self initWithLocation:location emptyImage:emptyImageOrNil solidImage:solidImageOrNil - halfImage:halfFillerImageOrNil emptyColor:nil solidColor:nil - userInteractionEnabled:userInteractionEnabled initialRating:initialRating andMaxRating:maxRating]; } @@ -173,9 +153,12 @@ - (CGSize)intrinsicContentSize - (void)drawRect:(CGRect)rect { CGPoint currPoint = CGPointZero; + int wholeStars = (int)floor(_rating); + float partialStars = _rating - (float)wholeStars; - for (int i = 0; i < _rating; i++) + for (int i = 0; i < wholeStars; i++) { + if (_solidImage) { [_solidImage drawAtPoint:currPoint]; @@ -189,17 +172,14 @@ - (void)drawRect:(CGRect)rect currPoint.x += (_starWidthAndHeight + _starSpacing); } - if (_partialRating > 0.0) { - UIImage *partialStar = _halfFilledImage; - if (!partialStar) { - partialStar = [self partialImage:_solidImage fraction:_partialRating]; - } - + if (partialStars > 0) { + UIImage *partialStar = [self partialImage:_solidImage fraction:partialStars]; + [_emptyImage drawAtPoint:currPoint]; [partialStar drawAtPoint:currPoint]; currPoint.x += (_starWidthAndHeight + _starSpacing); } - - NSInteger remaining = (floor)(_maxRating - _rating - _partialRating) ; + + NSInteger remaining = (floor)(_maxRating - _rating) ; for (int i = 0; i < remaining; i++) { @@ -253,41 +233,38 @@ - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil - halfFilledImage:nil emptyColor:emptyColor solidColor:solidColor - userInteractionEnabled:YES initialRating:0.0 andMaxRating:maxRating]; } - (void)initializeWithEmptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil - halfFilledImage:(UIImage *)halfFilledImageOrNil emptyColor:(UIColor *)emptyColor solidColor:(UIColor *)solidColor - userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating { _respondsToTranslatesAutoresizingMaskIntoConstraints = [self respondsToSelector:@selector(translatesAutoresizingMaskIntoConstraints)]; - _rating = 0; self.backgroundColor = [UIColor clearColor]; self.opaque = NO; _emptyImage = emptyImageOrNil; _solidImage = solidImageOrNil; - _halfFilledImage = halfFilledImageOrNil; _emptyColor = emptyColor; _solidColor = solidColor; _maxRating = maxRating; - _rating = (int)(floor(initialRating)); - _partialRating = initialRating - (float)_rating; + _rating = initialRating; _starFontSize = kFontSize; _starWidthAndHeight = kStarWidthAndHeight; _starSpacing = kStarSpacing; - self.userInteractionEnabled = userInteractionEnabled; + + if(!_emptyColor && !_solidColor && _solidImage) + { + _partialStarsAllowed = YES; + } } - (id)initWithCoder:(NSCoder *)decoder @@ -296,10 +273,8 @@ - (id)initWithCoder:(NSCoder *)decoder if (self) { [self initializeWithEmptyImage:nil solidImage:nil - halfFilledImage:nil emptyColor:nil solidColor:nil - userInteractionEnabled:YES initialRating:0.0 andMaxRating:0]; } @@ -310,10 +285,8 @@ - (id)initWithCoder:(NSCoder *)decoder - (id)initWithLocation:(CGPoint)location emptyImage:(UIImage *)emptyImageOrNil solidImage:(UIImage *)solidImageOrNil - halfImage:(UIImage *)halfFillerImageOrNil emptyColor:(UIColor *)emptyColor solidColor:(UIColor *)solidColor -userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:(NSInteger)maxRating { @@ -324,10 +297,8 @@ - (id)initWithLocation:(CGPoint)location { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil - halfFilledImage:halfFillerImageOrNil emptyColor:emptyColor solidColor:solidColor - userInteractionEnabled:(BOOL)userInteractionEnabled initialRating:(float)initialRating andMaxRating:maxRating]; } @@ -349,10 +320,8 @@ - (id)initWithLocation:(CGPoint)location { [self initializeWithEmptyImage:emptyImageOrNil solidImage:solidImageOrNil - halfFilledImage:nil emptyColor:emptyColor solidColor:solidColor - userInteractionEnabled:YES initialRating:0.0f andMaxRating:maxRating]; } @@ -379,15 +348,12 @@ - (void)adjustFrame - (void)handleTouch:(UITouch *)touch { - if (!self.userInteractionEnabled) { - return; - } CGFloat width = self.frame.size.width; CGRect section = CGRectMake(0, 0, _starWidthAndHeight, self.frame.size.height); CGPoint touchLocation = [touch locationInView:self]; - if (touchLocation.x < 0) + if (touchLocation.x < 0 || touchLocation.x < ((float)kStarWidthAndHeight)/3.0) { if (_rating != 0) { @@ -411,19 +377,53 @@ - (void)handleTouch:(UITouch *)touch } else { + float halfWidth = (float)_starWidthAndHeight/2.0; + for (int i = 0 ; i < _maxRating ; i++) { - if ((touchLocation.x > section.origin.x) && (touchLocation.x < (section.origin.x + _starWidthAndHeight))) + if (touchLocation.x > section.origin.x) { - if (_rating != (i + 1)) - { - _rating = i + 1; - if (self.editingChangedBlock) - { - self.editingChangedBlock(_rating); + if (_partialStarsAllowed) { + // first half of the star + if (touchLocation.x < (section.origin.x + halfWidth)) { + if (_rating != (i + 0.5)) + { + _rating = i + 0.5; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + break; + } + + // second half of the star + if (touchLocation.x > (section.origin.x + halfWidth) && + touchLocation.x < (section.origin.x + _starWidthAndHeight)) { + if (_rating != (i + 1)) + { + _rating = i + 1; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + break; + } + }else{ // only wholestars + if (touchLocation.x < (section.origin.x + _starWidthAndHeight)) { + if (_rating != (i + 1)) + { + _rating = i + 1; + if (self.editingChangedBlock) + { + self.editingChangedBlock(_rating); + } + } + break; } - } - break; + } + } section.origin.x += (_starWidthAndHeight + _starSpacing); } diff --git a/Demo/Controller/StarRatingControlViewController.m b/Demo/Controller/StarRatingControlViewController.m index 9d64842..e49615b 100755 --- a/Demo/Controller/StarRatingControlViewController.m +++ b/Demo/Controller/StarRatingControlViewController.m @@ -46,19 +46,16 @@ - (void)viewDidLoad // - 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 - UIImage *dot, *star, *halfStar; - dot = [UIImage imageNamed:@"empty_star.png"]; - star = [UIImage imageNamed:@"full_star.png"]; - halfStar= [UIImage imageNamed:@"half_star.png"]; - + UIImage *emptyStar, *fullStar; + emptyStar = [UIImage imageNamed:@"star_rating_empty.png"]; + fullStar = [UIImage imageNamed:@"star_rating_full.png"]; + StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 250) - emptyImage:dot - solidImage:star - halfImage:halfStar - userInteractionEnabled:NO - initialRating:3.6 + emptyImage:emptyStar + solidImage:fullStar + initialRating:3.5 andMaxRating:5]; - + // Create an instance with custom color, 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). @@ -70,7 +67,6 @@ - (void)viewDidLoad - // Add the control(s) as a subview of your view [self.view addSubview:simpleRatingControl]; [self.view addSubview:imagesRatingControl]; diff --git a/StarRatingControl.xcodeproj/project.pbxproj b/StarRatingControl.xcodeproj/project.pbxproj index 07b6163..902e6b2 100755 --- a/StarRatingControl.xcodeproj/project.pbxproj +++ b/StarRatingControl.xcodeproj/project.pbxproj @@ -13,14 +13,9 @@ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 758D370E112C04F6003C8E62 /* StarRatingControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 758D370D112C04F6003C8E62 /* StarRatingControl.m */; }; - 758D3711112C0881003C8E62 /* dot.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D370F112C0881003C8E62 /* dot.png */; }; 758D3712112C0881003C8E62 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D3710112C0881003C8E62 /* star.png */; }; - A9542A9918E1FAF300145FB6 /* empty_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9318E1FAF300145FB6 /* empty_star.png */; }; - A9542A9A18E1FAF300145FB6 /* empty_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9418E1FAF300145FB6 /* empty_star@2x.png */; }; - A9542A9B18E1FAF300145FB6 /* full_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9518E1FAF300145FB6 /* full_star.png */; }; - A9542A9C18E1FAF300145FB6 /* full_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9618E1FAF300145FB6 /* full_star@2x.png */; }; - A9542A9D18E1FAF300145FB6 /* half_star.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9718E1FAF300145FB6 /* half_star.png */; }; - A9542A9E18E1FAF300145FB6 /* half_star@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542A9818E1FAF300145FB6 /* half_star@2x.png */; }; + A9542AAD18E270A000145FB6 /* star_rating_empty.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542AAA18E270A000145FB6 /* star_rating_empty.png */; }; + A9542AAE18E270A000145FB6 /* star_rating_full.png in Resources */ = {isa = PBXBuildFile; fileRef = A9542AAB18E270A000145FB6 /* star_rating_full.png */; }; C94C7B021619D449008701B7 /* StarRatingControlAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */; }; C94C7B031619D449008701B7 /* StarRatingControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C94C7B001619D449008701B7 /* StarRatingControlViewController.m */; }; C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C94C7B011619D449008701B7 /* StarRatingControlViewController.xib */; }; @@ -36,15 +31,10 @@ 32CA4F630368D1EE00C91783 /* StarRatingControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControl_Prefix.pch; sourceTree = ""; }; 758D370C112C04F6003C8E62 /* StarRatingControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControl.h; sourceTree = ""; }; 758D370D112C04F6003C8E62 /* StarRatingControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControl.m; sourceTree = ""; }; - 758D370F112C0881003C8E62 /* dot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot.png; sourceTree = ""; }; 758D3710112C0881003C8E62 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = ""; }; 8D1107310486CEB800E47090 /* StarRatingControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "StarRatingControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - A9542A9318E1FAF300145FB6 /* empty_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = empty_star.png; sourceTree = ""; }; - A9542A9418E1FAF300145FB6 /* empty_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "empty_star@2x.png"; sourceTree = ""; }; - A9542A9518E1FAF300145FB6 /* full_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = full_star.png; sourceTree = ""; }; - A9542A9618E1FAF300145FB6 /* full_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "full_star@2x.png"; sourceTree = ""; }; - A9542A9718E1FAF300145FB6 /* half_star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = half_star.png; sourceTree = ""; }; - A9542A9818E1FAF300145FB6 /* half_star@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "half_star@2x.png"; sourceTree = ""; }; + A9542AAA18E270A000145FB6 /* star_rating_empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star_rating_empty.png; sourceTree = ""; }; + A9542AAB18E270A000145FB6 /* star_rating_full.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star_rating_full.png; sourceTree = ""; }; C94C7AFC1619D449008701B7 /* StarRatingControlAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlAppDelegate.h; sourceTree = ""; }; C94C7AFD1619D449008701B7 /* StarRatingControlAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StarRatingControlAppDelegate.m; sourceTree = ""; }; C94C7AFF1619D449008701B7 /* StarRatingControlViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarRatingControlViewController.h; sourceTree = ""; }; @@ -108,13 +98,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - A9542A9318E1FAF300145FB6 /* empty_star.png */, - A9542A9418E1FAF300145FB6 /* empty_star@2x.png */, - A9542A9518E1FAF300145FB6 /* full_star.png */, - A9542A9618E1FAF300145FB6 /* full_star@2x.png */, - A9542A9718E1FAF300145FB6 /* half_star.png */, - A9542A9818E1FAF300145FB6 /* half_star@2x.png */, - 758D370F112C0881003C8E62 /* dot.png */, + A9542AAA18E270A000145FB6 /* star_rating_empty.png */, + A9542AAB18E270A000145FB6 /* star_rating_full.png */, 758D3710112C0881003C8E62 /* star.png */, 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 8D1107310486CEB800E47090 /* StarRatingControl-Info.plist */, @@ -213,16 +198,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - A9542A9D18E1FAF300145FB6 /* half_star.png in Resources */, - A9542A9B18E1FAF300145FB6 /* full_star.png in Resources */, - A9542A9C18E1FAF300145FB6 /* full_star@2x.png in Resources */, + A9542AAD18E270A000145FB6 /* star_rating_empty.png in Resources */, 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 758D3711112C0881003C8E62 /* dot.png in Resources */, - A9542A9E18E1FAF300145FB6 /* half_star@2x.png in Resources */, 758D3712112C0881003C8E62 /* star.png in Resources */, - A9542A9918E1FAF300145FB6 /* empty_star.png in Resources */, - A9542A9A18E1FAF300145FB6 /* empty_star@2x.png in Resources */, C94C7B041619D449008701B7 /* StarRatingControlViewController.xib in Resources */, + A9542AAE18E270A000145FB6 /* star_rating_full.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/star_rating_empty.png b/star_rating_empty.png new file mode 100644 index 0000000000000000000000000000000000000000..2e98168554d5b4a240acd2265c5210deb6ef1dfb GIT binary patch literal 1944 zcmbVNc~BE)6c5#U*0!UyBi3UZQ3sV|HzeecfJqhA`y~}n+*iof@l?w z!3!0oBUY>8(263r7D2QEML|W74g$dfwh98GAm!?}1gxEL{G)F+FTeNp_m1z|_wDZX z@m@Y<(#%N=24jlH3RD69XVAY1V;BsZAJPWa0mGJZQ&GM|FcpE3I76Z#HsX+n4%>t) za7+`qr4)B&FvbLHl`2Xl_Y$cI9Sfs5EVIr4q8SWlSF-_AhvF2p5#OZMi<#|L3z(2r zBWAAU$zi!chKFcZM3J~}l($kH6{;3$n6566vsnZZ=x_>y%(^hWQDhb~hx3X6rrm5N zG)$pF#Y}5cD!C6NBS;+Lv0w)^>;ywj2n%uK^7;HF5C=wJHq2oo90!Cia^#3$7#a~K zs77jnMGDk?q!zHm%n*t)h}i6ihzM4MBa0w6u@RwANax^i900??7^$Z)vxD9^Z!`mn z8`Y%NKxqj*L}$b{5++K_1f5!!pfkwjZxZW`BO3*_jBUmYY=i}~bvk-o!)zm^!2fOI zoou5r(txuSxREfCYVbUQ=Zyw~y?cKlnh3fPtt7SJp`Llncxmfqt%FD zL;xcQp9}Lju#*5m1boC@%5|4X1Uwl>;3yl-@vc~@laRxax*;4y=7=C}u#gY)g-!yP zD--Zg8Oj@t_0StBOs~dA>uN#Wky!Y>u_76XV-!Iu2_kHC0(?RUiZF%{21w@1gXEZ6 ztEX-H@mN=j;-oel*SM2}4jSHHk@g++-6eeYx7RI1U?D2xqFhIq3!^;HyERtxfA)+G znqkw!@z$`6y1)d|@XhE0DHg;Gc+^=^n0$kbLZOI z+jF^GS65drFE5o!h2uC$l3TZKjgOB{N=iyeNy*5_C@d`8zkh#na&mTdc6oVuVq&5b z+s;+sAmuLv$uC~Kn46n><;s=x^mK5yqN2hZy%&CSg%EiK2s(*T^j3-25jfUByifUX-B0IawmSzB~c`{1lU2mzk5 zW6STK!z#}OS$+-xW@r61EAz#pJOEl-TOXWouTEZ3e|~jOL!RaQDv%raAD&zeKu=v} zYo6B12fD8@r_YkrZ7JxsGx2*LM#9-I){6cV|aej(^|n?IWDqu{0=) z?)$6E>Uo{F23!NTV`%eH>OfgE4JzXLD|TB619$h*peUsO#^!s;r|GxrK1$*33*MLG zCQkoi&X;xz9UT87Tpo|d7YIboVzJo8#dR4i5{VS`Ug@*SSE*dR#?L<>VBPw_APpWI zrXx+^F|j*##KpzM#~(P9aQMiP#KdFAk0&L4f9mwv^A|2&&ibYB#;wwd`&CsnHMO<1 z^$m@UkDH#fJ#X*m=;-R|>hA6B9~}Jj60;7>li356C}-HpukQ~02xAmCwiBT{_m!5Y z>c~J$T0YJjnd73G6-_)hEhcbFjWDmS_-fF1|?D%%VuU_kCeuGh-@MmKs zbAIdgQcnKrgKOvP6ru7bM;95!$l#W~8{5?P{@k<6)GrxV9Y6WbN!-WfVM7-Cc$jnL z(nB8>b^9+q1na9+gdMa*u&gBkT{718X7owvxazFM4F_XirT0EI*(%Q@4xYFW8kO&q zF!lF?^_B6ZP1n-~^T?9%&vve}S#_amj%VQ|BHrVJ`f62ZopzwEcn?XX>afw`9zyQjvdyScG5VWn~6^z^hBPxoJqd;08?hKiI$)76_zkz1m} z|6bKIxc*jb^1{lDuDxYH`C6J5)cVg1Kg!L_l()>nlnyW3YR(X+Jg26|cDBv`W6b4U z;)47OP34Y$H(w+=SA@=<752)x{RQ7o6%aEga$QNTCHVCCZk8Ou+ XKIfnc@9?i7`djJY=8dLFgSPzxl=4vA literal 0 HcmV?d00001 diff --git a/star_rating_full.png b/star_rating_full.png new file mode 100644 index 0000000000000000000000000000000000000000..a04a9322d28d3d026fa4e43b9fcc06617a9525bd GIT binary patch literal 1812 zcmd5-Yfuwc6b|YzlosE1d{k$R4wSaZ?gm00L*$Vq5+x~wI7X|KCD}j<*^S8}K|v7# zhtdMYLPbTbpw?QjpcT}yg0zZt5OjpWLJ?m@Tc=2AwItc4H$1FA9Dn$$JG*z!xqH6z zK6mq@)ysXn=X-NF93N#QrUCD{?#F8~hvRXehFJ%gd31!1j-`xr8g3;xVFoIJfRtuD zkaDqeZ7F?f9&`<)AXd-3YfwSki zkjWt9t`@2gl|@b@nIbn?iP%kQt$tIoUSi;eEQ5mWQlP+0&^Tl_r;s+OUB(^ND+RQB z8|FfzB6PBhJLZ&56%ENLD**}l2v3g$Ay5#?M*{*yBGG%006`HL5x}T`hl->D0x5z( z;};iLvl@(24W<~k1vnWuiKZ=57*0z|k(zawm z14h{NR+EJ`Q6%Knh$m2~w2TWp9Sgy1QK_COCT-)10x5&-xCKV}2y8aH;~JH=(Hi1E zH(n@h)23SpSVP#TRI47;!?%JWMQ<3&a8P2^}xOh6hOmf^ZBIpz;6|jX)$KL?j6k zBY|?U5R+rV39OQ|(Kx9mChVGk-Epk^rC6!lO5ikQ)lyW-L?^`Vis$2&poj#M1Y&^!NFagi;B z2F}3l=6J4ICbmEay2)p)5141eLy%x%tY9>@^$+@j=`4zl(nh#WM~{q*fc5`y59dr9 z&YkASndQix?Z}(s_;|jfV1eV4IgaARjWu450+xfga;AkKY=^C0Z36gjJ4 z=TWiqsKohoi1S#e^P5m-joekc%vBfas*7};TifN~r_RUQD7N$LmxkfVAz?#k6*vNEP zn2rt1&)H1(cBUtr?aE+#>}*di+f&T;Ze?$ku(!(CzMX7e8G9#-y;H>A-Ob+H%l=x) z_J7Xym$Lo)*nU7)u@4K`-wN4* zFF0Hsqg}f`-k7p&$EU?R%MTv9HxE>mRAOP;x${&_ z`607$&ZXM}RQZhET~kjTy7AF>wUsvxBjnFSGl6rs}@W89dN^W~oP9r$Z9aFZ&S5(2&)1y&9q#{gc=uC?W!_c{+YOZY$;nwjLIoWxK2AhRUvN#Q=v z5##EpNs5xJJu?3oZs{a#Xw0LZjt{h=+Q!pXPi;`JTpwl_1?KR#4guJ1e%TeLE&Reg9NuB|UDDxFJJmtj?8Lw!<% z`pwS@nEHZ6am5i!ZGK+aSCL0=WcU5CYK_is(fafIRcHEqnav{KcMS0zzHb#?mVCJ6 Zu2&5bRWs$t%@ywdlrln%)r7}q{|i<-9`*nL literal 0 HcmV?d00001 From 6d9cd32e836812cbabab228765360c037fb142b1 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:43:03 -0700 Subject: [PATCH 18/30] Delete dot.png --- dot.png | Bin 1054 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 dot.png diff --git a/dot.png b/dot.png deleted file mode 100755 index 6830be7bf659ca4e11942810cdb2466bbc7acf68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1054 zcmV+(1mXLMP)4Tx0C)j~luKyTP!xv$j46V&f~d6?l;A>(v?V^!ics5Wwbqew82iv7$TV|j z8cj1XnHe95NI~5BT8bMVh>I%XLb_0Jr3;Zl>uXU2ait=NLN`*z|0eBBDpoHf`Et&G z&+CQ&RS#2+V?{Jz*v`AjuBdkC@PM{>0#&F%HMmlS=d>ph`+cTXKIgCLw@{>IvPs5@ z^&Ob_v~BhMOOImj>z?-dp85KDZ#6Cx0*XfKifq7JB@YI?SMtfclc(m0WMe3mCOhOt zw#riT4Se#lwS z#+8o&t!scqFDteI4;Z}*tXf~OHPits`+>1772D6GKOd!b+{A`0|qDVJm*eY<&{#wR+wXk~+^2z=p=Y+R=mX(oos*|%sGu!%-7M;7vjpTb7b5A$9 zf!9>V-P0SeveC?U_XHg2v#mJKMQS2-_F((~nei3X$w%cpB#(H-gEFRXKbG2;AlK8L zJf4e5O)dAfof+!k8A(>GGeaHmS$^#nk}~f)YVJ6e|IM?u$a5Tq1pyN_?>00f(S<0Q z;J`%=8G1}AOj@O1&}zcN@xLl9B+9!iD!TBQdp`SnPN2ZuGJYSTaf~#UBWU_N{hR(q zzp3BRzh0>?G*mnz?orbizxjPhMHy6s|5~ zU#Ty9G?_zOj8BKU6roH_7-T%zwd}q~w)iIed~?|rnjW<;&OWKDSQAA9qOkFZ>Mwg%u5aOFKIN000Sa zNLh0L01FcU01FcV0GgZ_0001qNklZGNmPs_^6=C`%AJ;$dHr(A4o>?$!avA;kC|3MhU28rR+0F+?DB? Date: Tue, 25 Mar 2014 20:43:16 -0700 Subject: [PATCH 19/30] Delete empty_star.png --- empty_star.png | Bin 1146 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 empty_star.png diff --git a/empty_star.png b/empty_star.png deleted file mode 100644 index a4adfd5837d5fe28408ecebd39199f6a81ce49f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1146 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CN!3HF~3v%Ltlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6H#24v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`GuBNuFf>#!Gt)CP zF*P$Y)KM@pFf`IP03tJ8LlY}gGbUo-h6WQb!1OB;3-k^33_xCjDfIQluQWFouDZA+C>7yetOgf{R2HP_ z2c;J0mlh=hBQ8xDWL1Hcb5UwyNq$jCetr%t6azByOY(~|@(UE4gUu8)!ZY(y^2>`g z!Rmc|tvvIJOA_;vQ$1a5m4GJbWoD*W8JoBmyEz&fIhmLk8ydPATN*f9IGI?O7@9db zn>ac-!t}c2Czs}?=9R$orXchhv@OxDQ@3}*nd#5+$H$B>F! zITLNU9TP>4zdzdGv#(*g)A9jLdR>0uU-43lgp;KF41V7elpF0ZRzXs zFL!p?z6;)8eQxjb`g`-TBc`Rku$i?{N91nOGMhQiZ+6X|q1vJ-`by^hxgE!U*sI<+ z%#v00;dHwdg+Gf6jR~y25B$AgN>rPlTVamq@El$TdhB*Re zF>X_iC?3;3Dd(a;XHJi^!h5B4x01G8%g>y8CG_oA<@;?))5Pa1PiSBk74|BbUi*M2 z@W!j_THdS)Y~nvo#1({cw%v1#I=3+Czs|0&2B|yiqQ8hHFmUH(?Os Date: Tue, 25 Mar 2014 20:43:26 -0700 Subject: [PATCH 20/30] Delete empty_star@2x.png --- empty_star@2x.png | Bin 1436 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 empty_star@2x.png diff --git a/empty_star@2x.png b/empty_star@2x.png deleted file mode 100644 index b8fbdf3062c072ca7ea775dc6b5b5cecf2cf0c57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1436 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCJdP6mkoIHoK%2WtOF;xE1B+DuBIgm5JLe#yHJ` z>P^Az789I$^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5?;%{gPo|U=r|jaSW-r zwPvcXM@XQ^@wox!y;c!v3NOxdh$UKT-<`5xi}9uyj;!1g!90d*pLkHva!Prq6pmaOp0UzWYMQU3Y9-yiLt->E(?+n*X4xorPm z^@CbIz2zE4$-AD#T)SDf*q}vu{cApfz1=%`r$5~I(yITYnBu(V$X2emRujykzusNT zvn%wE@t(%dAFfR0>Db4ynbB^?`rMPxBvzeFdRuQS5%TeSM{U4C%@b{jOeajwHJoJh zIdQCXg5As#=8vLt!y6)-g3hWeiu5ddt>9RbTz5uTn&ZpoLU-0$KF2f8;X!xAd{m#Y znxuFn_{ga6uV-1bfrI;l=rqATsXH4KVw$xta8G}ryG3nVhi93({6f};KO(gPjDIDG zyFb<_JYiyHdNnqq>AKX-{axETf2@plX_pDud$)7pj*fFnJC4h)UuiYbXNlAMjXN$L zaAy}eygQ`uxK)Cagz>uh=Dad@f~+5xdSaL!#d$1>lxP{oRcrCaV~nBw$R6TV*Pfzij|KU zFCW*FtXm#Um^_h1_Lr_SbbM=AbF#Un z^1;7n4s!M@A91SvH_|byRFOZZeeKPS<8|By46n?O_ZaS5u@zKadb;|#taD0e0syDw B6wm+w From 279de1cd2787f69b1eb0cfbc0985650b9407d475 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:43:35 -0700 Subject: [PATCH 21/30] Delete full_star.png --- full_star.png | Bin 1101 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 full_star.png diff --git a/full_star.png b/full_star.png deleted file mode 100644 index a1783210d37c3f7fb400a769c704c48a6f570d11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1101 zcmaJ=TWHfz7*1E&t=pJWygqoyM5e4w(@VC7)m@rS>uf1q!QmX5CTDHzl9MH8Hk*Q* zC`^5ss1LqPaNvuI;DaD2LSKAZ5g&#Ris-92eHwT@nQQgI8j_p~-}n9h`Ty@+P9_dD zH|}brD5^PjSV)nviF~g5TJj&#Cr*-KCytKbVKj~lq5-LX8D$`dsbUtUpeRpIzJNUx z<)oGL2p)+auF=RGqLXs;Ae|MJW$4$iS?kh3QXEp3y*&!}PIW+#A;;FsB@z zG2rk_A}!72rI1Yb9t1rWPXttmMPR8Dn#o&XdR><%b9K-&<9tdO+=xY1VLFGg&NED* zQ1BG|9%N)0HWUik8a|(!Al&A(hDFP*neAl-0h*Gb=vYA-uocA&n!;h4WcvFEs$P-R z%#AXUf-#n;GpxsJAE^wC$Nvvi)e73gDflPfe+rxFX&o{tXrd`YB8?kww?pZC#DF43 zMjD}saut&~gprv;I*1H&pyQaL$*5rNU&qJed`vU3s7Wv;glVGSQ52c?`Gb*Amp?QR z2>4kx>L1`(Z`9Wv9qk}+buEg`0(4V$m zXV!lH>~-=#PAugbisH(L9sQepYpHw1`a6l5hpnyo&yU`Gz0|o}oNdU=t!$mYIoItP zYnyPE(k)=LZoYZ;v15Me_7^nwc=!AR=jR}Jx?GR*dls&_ik(dtpYL6`etLF|+I%Hj zGwIk;8h$(5bRN7J>YLn`{CM8#aD0DPbLY(a(qdiu+|KZgSF0JkzR8~ke-aWqkx_!Z8(S&e+;M9d**oI*1 From 1cc57a97bcfd29b1fb98d3815eb589079a8ef228 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:43:41 -0700 Subject: [PATCH 22/30] Delete full_star@2x.png --- full_star@2x.png | Bin 1282 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 full_star@2x.png diff --git a/full_star@2x.png b/full_star@2x.png deleted file mode 100644 index 8d38f95deec7881c4439478c2f1d46805db60024..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1282 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCv@ozVa4~Xo zHg+>Ngz0t3PcF?(%`1WFO+n~2!KoLN6mkoIHoK%2WtOF;xE1B+DuBIgm5JLehB(cG z>P^Az79*T`^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5;`|E4UdL7|T3e978H@ zCH?vT-=2Bn1MjVq_$C-V&fII>A7Sgmv!t<3A&)ich;u1-L)$M#O>u>343C78z8VS% zyEq(@m!qa$ zwHI2B76>FTKGIvje52zVW57nG2}TZwb~&u^IKZed|4#EU!4u1`H%dHNE$wi>HtkQ$ z(g>a>KOA^P5*Fyq;NV*1dx2xgwujk`JEm~H=)LXGrYvB;bkoC$4x8(nl_j$}g$3*v zPkI=ra5ykXFyMjM74`Eg5`O5fIVqCGc|!gCNrM{MT@NEZGX@;=RWR-3;eNJIx=(+x z=H$diCQZx8HuJ|U zg@4{B*d>mdUSL1zki{oZ&+usF0ufe|FQR>mWKuHh1e(8mU^0|n(V(2dxZ(rz)r89p sUG{>JbDK_WEK!K#yYiVMl273P!_(M$6JO2x5>Tn+>FVdQ&MBb@04Vgc1^@s6 From 3bb92dba48ddfa2fd076010676063c5ac9983492 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:43:48 -0700 Subject: [PATCH 23/30] Delete half_star.png --- half_star.png | Bin 1127 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 half_star.png diff --git a/half_star.png b/half_star.png deleted file mode 100644 index 212214e142740566b6c2a3e81c348ac6bb92ea0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1127 zcmaJ=TWHfz7!D5RZ3U5`%y~IR1#eB7wyA4aH`=D1RWoW==uo_5$>|o>-p3%TmF0rLprhgSx(UKZVreGUkO3S;xdnCL5KS`ueFWVc zlQrzoGLeF@1=(ad#^W5R2$ZD%Lv?)&ZQ~UDlkY!;?R2LJ*%Y)7eOd)DP z86zu=P_9_TWE;ZBZbK%BHU+@KjAp1PZ!a3bOOlWFAren4xi!tLvgSg!ywr(95c5c?&gcwd2 z`tb|*;%%?Ui58+zorGo@O5&+h>&@4nJ+Vu|}fz)DLvWPRs#&Ksi70 z`kf`!>bmi>vwiR0oLZY%@#*N-kMFA&FX(#PbL+!#S8m$b>SqgIeH&Uo{TbRfdfl+EbhqFdsOx1YxWnJd9^n?|6rsyzVpDb85g@Rox3mpEbBkgu=M5Bt$oSL zpFC&uHdMS`va2q^f1kDG!tT@kxjTn`%$a-s{F5!J{(SKB(1Xgs;Y`hNdor_sVAD3& hy1@$i-B8a>s*DncVlN-nEvR>{ej?T=UWsh%{sr8EdszSg From 8b93f1b398264d380b9195a604af9942baedfc6f Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:43:57 -0700 Subject: [PATCH 24/30] Delete half_star@2x.png --- half_star@2x.png | Bin 1377 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 half_star@2x.png diff --git a/half_star@2x.png b/half_star@2x.png deleted file mode 100644 index afd1f57775efab301821e35afe474171858f361a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1377 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCP^Az79*T`^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5-?rGF~$TFnepg$%H#6u5gtGF#gm^v6Q)SgSFD8Rp{)K zsLi{YxX=C&x}E;Ja#7Cg>1-TU%Dv`C8rhT?bsQ(R|7@C)A-Ku+NU}_Mi)H(OV8*^IaLYwdZ&KjsPc?{d|7^ZzL4 zBc&=4<$uqre6M;+*Zll&k-c?;sP?;GvI!ebmpnM^*nDpF#z%4TQ7ie`x5rgKvefvt zqEh+BGQLZX?z;7N@IT~HFN*tI@K~GKtj)$~_r=!{yvhaqZ+}J4% Date: Tue, 25 Mar 2014 20:44:09 -0700 Subject: [PATCH 25/30] Delete star.png --- star.png | Bin 1301 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 star.png diff --git a/star.png b/star.png deleted file mode 100755 index e086171ec460e72720b9cb1cdb4dc4ce89d95b34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1301 zcmV+w1?u{VP)4Tx0C)j~luKyTP!xv$j46V&f~d6?l;A>(v?V^!ics5Wwbqew82iv7$TV|j z8cj1XnHe95NI~5BT8bMVh>I%XLb_0Jr3;Zl>uXU2ait=NLN`*z|0eBBDpoHf`Et&G z&+CQ&RS#2+V?{Jz*v`AjuBdkC@PM{>0#&F%HMmlS=d>ph`+cTXKIgCLw@{>IvPs5@ z^&Ob_v~BhMOOImj>z?-dp85KDZ#6Cx0*XfKifq7JB@YI?SMtfclc(m0WMe3mCOhOt zw#riT4Se#lwS z#+8o&t!scqFDteI4;Z}*tXf~OHPits`+>1772D6GKOd!b+{A`0|qDVJm*eY<&{#wR+wXk~+^2z=p=Y+R=mX(oos*|%sGu!%-7M;7vjpTb7b5A$9 zf!9>V-P0SeveC?U_XHg2v#mJKMQS2-_F((~nei3X$w%cpB#(H-gEFRXKbG2;AlK8L zJf4e5O)dAfof+!k8A(>GGeaHmS$^#nk}~f)YVJ6e|IM?u$a5Tq1pyN_?>00f(S<0Q z;J`%=8G1}AOj@O1&}zcN@xLl9B+9!iD!TBQdp`SnPN2ZuGJYSTaf~#UBWU_N{hR(q zzp3BRzh0>?G*mnz?orbizxjPhMHy6s|5~ zU#Ty9G?_zOj8BKU6roH_7-T%zwd}q~w)iIed~?|rnjW<;&OWKDSQAA9qOkFZ>Mwg%u5aOFKIN000Sa zNLh0L01FcU01FcV0GgZ_0004iNkl}s-nrf z>$=BCt|%sLC1aB{B2Cl7qA0Gas@em^BXD7kocHmn3H-l-T^3lp!b;e;oGa5b-;yM` z!P*eEZJz>sf&aUcjb=WC8q}iTdicJ-i>KUUv5^>SSSw|QljArGJn>T{Oor@GVI+cn zJ43go2X74$O~8^&6OrC%W21r3al4a01LnvK)DRdIL<`N^Fn$bA zw05k|v~wLFH@1V%A^!Q>e-M}{n_n`Z7vVUg##6GaifU#$^_;Sp=J;QvBDvS^2g$XzbK00000 LNkvXXu0mjf418)& From 3a13f411bedc14220278a4046577b0f8b54bd6a9 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:49:08 -0700 Subject: [PATCH 26/30] Update README.mdown --- README.mdown | 87 +++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/README.mdown b/README.mdown index dda5a74..fd7a307 100755 --- a/README.mdown +++ b/README.mdown @@ -18,46 +18,55 @@ Add `StarRatingControl.h` and `StarRatingControl.m` to your project. ``` objective-c - -#include "StarRatingControl.h" - -// Create a simple instance, initing with : -// - a CGPoint (the position in your view from which it will be drawn) -// - and max rating -StarRatingControl *simpleRatingControl = [[StarRatingControl 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]]; -}; + #import "StarRatingControl.h" + + // Create a simple instance, initing with : + // - a CGPoint (the position in your view from which it will be drawn) + // - and max rating + StarRatingControl *simpleRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(90, 50) + andMaxRating:5]; + + // Customize the current rating if needed + [simpleRatingControl setRating:3]; + [simpleRatingControl setStarSpacing:10]; + + // 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). + // - initial rating (how many stars the rating will have initially when displayed) + // - and max rating + // This control, when initialized with (at least) the fullStar image will support partial rating stars, i.e., 3.5 + UIImage *emptyStar, *fullStar; + emptyStar = [UIImage imageNamed:@"star_rating_empty.png"]; + fullStar = [UIImage imageNamed:@"star_rating_full.png"]; + + StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 250) + emptyImage:emptyStar + solidImage:fullStar + initialRating:3.5 + andMaxRating:5]; + + // Create an instance with custom color, initing with : + // - a CGPoint (the position in your view from which it will be drawn) + // - colors for "empty" and "full" rating stars + // - and max rating + StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 370) + emptyColor:[UIColor yellowColor] + solidColor:[UIColor redColor] + andMaxRating:5]; -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 -StarRatingControl *imagesRatingControl = [[StarRatingControl 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 -StarRatingControl *coloredRatingControl = [[StarRatingControl 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]; From d120a761a806214629c7d09fbc711d2a944aed71 Mon Sep 17 00:00:00 2001 From: xeniah Date: Tue, 25 Mar 2014 20:51:56 -0700 Subject: [PATCH 27/30] updated license --- Demo/Controller/StarRatingControlViewController.m | 4 +++- LICENSE | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Demo/Controller/StarRatingControlViewController.m b/Demo/Controller/StarRatingControlViewController.m index e49615b..f53d3b7 100755 --- a/Demo/Controller/StarRatingControlViewController.m +++ b/Demo/Controller/StarRatingControlViewController.m @@ -45,7 +45,9 @@ - (void)viewDidLoad // 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). + // - initial rating (how many stars the rating will have initially when displayed) // - and max rating + // This control, when initialized with (at least) the fullStar image will support partial rating stars, i.e., 3.5 UIImage *emptyStar, *fullStar; emptyStar = [UIImage imageNamed:@"star_rating_empty.png"]; fullStar = [UIImage imageNamed:@"star_rating_full.png"]; @@ -58,7 +60,7 @@ - (void)viewDidLoad // Create an instance with custom color, 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). + // - colors for "empty" and "full" rating stars // - and max rating StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 370) emptyColor:[UIColor yellowColor] diff --git a/LICENSE b/LICENSE index 3361a37..0d4074b 100755 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012, Ameddi +Copyright (c) 2014, Xenia H Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 1a00ec26eeaafa0f1edfa07edda3bfe95044e497 Mon Sep 17 00:00:00 2001 From: xeniah Date: Wed, 26 Mar 2014 18:33:48 -0700 Subject: [PATCH 28/30] slight edits of the sample app. Add screenshot --- .../StarRatingControlViewController.m | 6 ++-- .../StarRatingControlViewController.xib | 31 +++++------------- Screen Shot 2014-03-26 at 6.29.49 PM.png | Bin 0 -> 49285 bytes StarRatingControl | 1 + StarRatingControl.xcodeproj/project.pbxproj | 4 --- 5 files changed, 12 insertions(+), 30 deletions(-) create mode 100644 Screen Shot 2014-03-26 at 6.29.49 PM.png create mode 160000 StarRatingControl diff --git a/Demo/Controller/StarRatingControlViewController.m b/Demo/Controller/StarRatingControlViewController.m index f53d3b7..fac235a 100755 --- a/Demo/Controller/StarRatingControlViewController.m +++ b/Demo/Controller/StarRatingControlViewController.m @@ -23,7 +23,7 @@ - (void)viewDidLoad // Create a simple instance, initing with : // - a CGPoint (the position in your view from which it will be drawn) // - and max rating - StarRatingControl *simpleRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(90, 50) + StarRatingControl *simpleRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(80, 60) andMaxRating:5]; // Customize the current rating if needed @@ -52,7 +52,7 @@ - (void)viewDidLoad emptyStar = [UIImage imageNamed:@"star_rating_empty.png"]; fullStar = [UIImage imageNamed:@"star_rating_full.png"]; - StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 250) + StarRatingControl *imagesRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(90, 220) emptyImage:emptyStar solidImage:fullStar initialRating:3.5 @@ -62,7 +62,7 @@ - (void)viewDidLoad // - a CGPoint (the position in your view from which it will be drawn) // - colors for "empty" and "full" rating stars // - and max rating - StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(110, 370) + StarRatingControl *coloredRatingControl = [[StarRatingControl alloc] initWithLocation:CGPointMake(90, 380) emptyColor:[UIColor yellowColor] solidColor:[UIColor redColor] andMaxRating:5]; diff --git a/Demo/Controller/StarRatingControlViewController.xib b/Demo/Controller/StarRatingControlViewController.xib index 7ee9319..a4d021e 100755 --- a/Demo/Controller/StarRatingControlViewController.xib +++ b/Demo/Controller/StarRatingControlViewController.xib @@ -7,7 +7,6 @@ - @@ -18,42 +17,28 @@ -