diff --git a/.gitignore b/.gitignore index 4d3915b..d81194d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build/ *.pbxuser *.perspectivev3 +.DS_Store diff --git a/Classes/FavStarControlAppDelegate.m b/Classes/FavStarControlAppDelegate.m index 2433c02..6d97a4d 100644 --- a/Classes/FavStarControlAppDelegate.m +++ b/Classes/FavStarControlAppDelegate.m @@ -16,9 +16,11 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { - (void)dealloc { +#if !__has_feature(objc_arc) [viewController release]; [window release]; [super dealloc]; +#endif } diff --git a/Classes/FavStarControlViewController.m b/Classes/FavStarControlViewController.m index f2da16d..7b59d15 100644 --- a/Classes/FavStarControlViewController.m +++ b/Classes/FavStarControlViewController.m @@ -25,12 +25,19 @@ - (void)viewDidLoad [super viewDidLoad]; UIImage *dot, *star; - dot = [UIImage imageNamed:@"dot.png"]; - star = [UIImage imageNamed:@"star.png"]; - JSFavStarControl *rating = [[JSFavStarControl alloc] initWithLocation:CGPointMake(110, 220) dotImage:dot starImage:star]; + dot = [UIImage imageNamed:@"dot10x10.png"]; + star = [UIImage imageNamed:@"star10x10.png"]; + JSFavStarControl *rating = [[JSFavStarControl alloc] initWithImages:CGRectMake(110, 220, 100, 20) + dotImage:dot + starImage:star]; + rating.rating = 1; + [rating addTarget:self action:@selector(updateRating:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:rating]; + +#if !__has_feature(objc_arc) [rating release]; +#endif } - (void)updateRating:(id)sender @@ -61,7 +68,9 @@ - (void)viewDidUnload { - (void)dealloc { +#if !__has_feature(objc_arc) [super dealloc]; +#endif } @end diff --git a/Classes/JSFavStarControl.h b/Classes/JSFavStarControl.h index d9ff1c5..1f5ae8e 100644 --- a/Classes/JSFavStarControl.h +++ b/Classes/JSFavStarControl.h @@ -9,19 +9,37 @@ #import +#ifndef JF_STRONG +#if __has_feature(objc_arc) +#define JF_STRONG strong +#else +#define JF_STRONG retain +#endif +#endif + +#ifndef JF_WEAK +#if __has_feature(objc_arc_weak) +#define JF_WEAK weak +#elif __has_feature(objc_arc) +#define JF_WEAK unsafe_unretained +#else +#define JF_WEAK assign +#endif +#endif @interface JSFavStarControl : UIControl { NSInteger _rating; - + CGFloat _fontSize ; UIImage *_dot, *_star; } -@property (nonatomic, readonly) NSInteger rating; +@property (nonatomic,assign) CGFloat padding; +@property (nonatomic,assign) NSInteger rating; // dotImage and starImage 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 dot/star // Use location to position the favstar control in your view - the control will manage its own width/height (kind of like UIActivityIndicator) -- (id)initWithLocation:(CGPoint)location dotImage:(UIImage *)dotImage starImage:(UIImage *)starImage; +- (id)initWithImages:(CGRect)frame dotImage:(UIImage *)dotImage starImage:(UIImage *)starImage; @end diff --git a/Classes/JSFavStarControl.m b/Classes/JSFavStarControl.m index 1fda4da..25fbc92 100644 --- a/Classes/JSFavStarControl.m +++ b/Classes/JSFavStarControl.m @@ -11,20 +11,83 @@ #define RATING_MAX 5 +@interface JSFavStarControl () + +-(BOOL)isFirstStarTouched:(CGPoint)touchLocation section:(CGRect)section; + +@end + @implementation JSFavStarControl @synthesize rating = _rating; +@synthesize padding; + +-(BOOL)isFirstStarTouched:(CGPoint)touchLocation section:(CGRect)section +{ + CGFloat w = (_star!=nil ) ? _star.size.width : _fontSize; + + return (touchLocation.x >0 && touchLocation.x < section.origin.x + w ); +} + +- (void)initialize +{ + _rating = 0; + _fontSize = self.frame.size.height -2 ; + self.padding = 15.0; + //self.backgroundColor = [UIColor clearColor]; + self.opaque = NO; + + +} + +- (void)setRating:(NSInteger)rating +{ + if( rating != _rating ) { + _rating = rating; + + [self setNeedsDisplay]; + } +} + +#pragma mark - initialization + +-(id)initWithCoder:(NSCoder *)aDecoder +{ + if( self = [super initWithCoder:aDecoder] ) { + + [self initialize]; + } + + return self; + +} + +- (id)initWithFrame:(CGRect)frame +{ + if( self = [super initWithFrame:frame] ) { + + [self initialize]; + } + + return self; +} -- (id)initWithLocation:(CGPoint)location dotImage:(UIImage *)dotImage starImage:(UIImage *)starImage +- (id)initWithImages:(CGRect)frame dotImage:(UIImage *)dotImage starImage:(UIImage *)starImage { - if (self = [self initWithFrame:CGRectMake(location.x, location.y, 100, 20)]) + NSParameterAssert(dotImage); + NSParameterAssert(starImage); + + + if (self = [super initWithFrame:frame]) { - _rating = 0; - self.backgroundColor = [UIColor clearColor]; - self.opaque = NO; - + [self initialize]; +#if __has_feature(objc_arc) + _dot = dotImage; + _star = starImage; +#else _dot = [dotImage retain]; _star = [starImage retain]; +#endif } return self; @@ -39,9 +102,9 @@ - (void)drawRect:(CGRect)rect if (_star) [_star drawAtPoint:currPoint]; else - [@"★" drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:22]]; + [@"★" drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_fontSize]]; - currPoint.x += 20; + currPoint.x += self.padding; } NSInteger remaining = RATING_MAX - _rating; @@ -51,21 +114,25 @@ - (void)drawRect:(CGRect)rect if (_dot) [_dot drawAtPoint:currPoint]; else - [@" •" drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:22]]; - currPoint.x += 20; + [@" •" drawAtPoint:currPoint withFont:[UIFont boldSystemFontOfSize:_fontSize]]; + currPoint.x += self.padding; } } - (void)dealloc { - [_dot release]; +#if !__has_feature(objc_arc) + [_dot release]; [_star release]; - +#endif + _dot = nil, _star = nil; +#if !__has_feature(objc_arc) [super dealloc]; +#endif } @@ -76,22 +143,29 @@ - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event CGPoint touchLocation = [touch locationInView:self]; - for (int i = 0; i < RATING_MAX; i++) - { - if (touchLocation.x > section.origin.x && touchLocation.x < section.origin.x + section.size.width) - { // touch is inside section - if (_rating != (i+1)) - { - _rating = i+1; - [self sendActionsForControlEvents:UIControlEventValueChanged]; - } - - break; - } - - section.origin.x += section.size.width; + if( _rating == 1 && [self isFirstStarTouched:touchLocation section:section]) { + + _rating = 0; + [self sendActionsForControlEvents:UIControlEventValueChanged]; + + } + else { + for (int i = 0; i < RATING_MAX; i++) + { + if (touchLocation.x > section.origin.x && touchLocation.x < section.origin.x + section.size.width) + { // touch is inside section + if (_rating != (i+1)) + { + _rating = i+1; + [self sendActionsForControlEvents:UIControlEventValueChanged]; + } + + break; + } + + section.origin.x += section.size.width; + } } - [self setNeedsDisplay]; return YES; } @@ -148,7 +222,11 @@ - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event CGPoint touchLocation = [touch locationInView:self]; - if (touchLocation.x < 0) + NSLog(@"endTrackingWithTouch touchLocation.x=[%f]", touchLocation.x); + + if( _rating == 0 && [self isFirstStarTouched:touchLocation section:section] ) return; + + if (touchLocation.x <= 0 ) { if (_rating != 0) { @@ -158,9 +236,9 @@ - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event } else if (touchLocation.x > width) { - if (_rating != 5) + if (_rating != RATING_MAX) { - _rating = 5; + _rating = RATING_MAX; [self sendActionsForControlEvents:UIControlEventValueChanged]; } diff --git a/FavStarControl.xcodeproj/project.pbxproj b/FavStarControl.xcodeproj/project.pbxproj index 85879bd..28cff9f 100755 --- a/FavStarControl.xcodeproj/project.pbxproj +++ b/FavStarControl.xcodeproj/project.pbxproj @@ -16,8 +16,11 @@ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 28D7ACF80DDB3853001CB0EB /* FavStarControlViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* FavStarControlViewController.m */; }; 758D370E112C04F6003C8E62 /* JSFavStarControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 758D370D112C04F6003C8E62 /* JSFavStarControl.m */; }; - 758D3711112C0881003C8E62 /* dot.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D370F112C0881003C8E62 /* dot.png */; }; - 758D3712112C0881003C8E62 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 758D3710112C0881003C8E62 /* star.png */; }; + A033B47E15A6D6DD003FEE36 /* JSFavStarControl.podspec in Resources */ = {isa = PBXBuildFile; fileRef = A033B47D15A6D6DD003FEE36 /* JSFavStarControl.podspec */; }; + A09CDEBE15A5FDD000452597 /* dot20x20.png in Resources */ = {isa = PBXBuildFile; fileRef = A09CDEBA15A5FDD000452597 /* dot20x20.png */; }; + A09CDEBF15A5FDD000452597 /* star20x20.png in Resources */ = {isa = PBXBuildFile; fileRef = A09CDEBB15A5FDD000452597 /* star20x20.png */; }; + A09CDEC015A5FDD000452597 /* dot10x10.png in Resources */ = {isa = PBXBuildFile; fileRef = A09CDEBC15A5FDD000452597 /* dot10x10.png */; }; + A09CDEC115A5FDD000452597 /* star10x10.png in Resources */ = {isa = PBXBuildFile; fileRef = A09CDEBD15A5FDD000452597 /* star10x10.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -35,9 +38,12 @@ 32CA4F630368D1EE00C91783 /* FavStarControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FavStarControl_Prefix.pch; sourceTree = ""; }; 758D370C112C04F6003C8E62 /* JSFavStarControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFavStarControl.h; sourceTree = ""; }; 758D370D112C04F6003C8E62 /* JSFavStarControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSFavStarControl.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 /* FavStarControl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "FavStarControl-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + A033B47D15A6D6DD003FEE36 /* JSFavStarControl.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = JSFavStarControl.podspec; sourceTree = ""; }; + A09CDEBA15A5FDD000452597 /* dot20x20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot20x20.png; sourceTree = ""; }; + A09CDEBB15A5FDD000452597 /* star20x20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star20x20.png; sourceTree = ""; }; + A09CDEBC15A5FDD000452597 /* dot10x10.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dot10x10.png; sourceTree = ""; }; + A09CDEBD15A5FDD000452597 /* star10x10.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star10x10.png; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -78,6 +84,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + A033B47D15A6D6DD003FEE36 /* JSFavStarControl.podspec */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, @@ -99,8 +106,10 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - 758D370F112C0881003C8E62 /* dot.png */, - 758D3710112C0881003C8E62 /* star.png */, + A09CDEBA15A5FDD000452597 /* dot20x20.png */, + A09CDEBB15A5FDD000452597 /* star20x20.png */, + A09CDEBC15A5FDD000452597 /* dot10x10.png */, + A09CDEBD15A5FDD000452597 /* star10x10.png */, 2899E5210DE3E06400AC0155 /* FavStarControlViewController.xib */, 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 8D1107310486CEB800E47090 /* FavStarControl-Info.plist */, @@ -169,8 +178,11 @@ files = ( 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 2899E5220DE3E06400AC0155 /* FavStarControlViewController.xib in Resources */, - 758D3711112C0881003C8E62 /* dot.png in Resources */, - 758D3712112C0881003C8E62 /* star.png in Resources */, + A09CDEBE15A5FDD000452597 /* dot20x20.png in Resources */, + A09CDEBF15A5FDD000452597 /* star20x20.png in Resources */, + A09CDEC015A5FDD000452597 /* dot10x10.png in Resources */, + A09CDEC115A5FDD000452597 /* star10x10.png in Resources */, + A033B47E15A6D6DD003FEE36 /* JSFavStarControl.podspec in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -202,6 +214,7 @@ GCC_PREFIX_HEADER = FavStarControl_Prefix.pch; INFOPLIST_FILE = "FavStarControl-Info.plist"; PRODUCT_NAME = FavStarControl; + SDKROOT = iphoneos5.1; }; name = Debug; }; @@ -214,6 +227,7 @@ GCC_PREFIX_HEADER = FavStarControl_Prefix.pch; INFOPLIST_FILE = "FavStarControl-Info.plist"; PRODUCT_NAME = FavStarControl; + SDKROOT = iphoneos5.1; }; name = Release; }; @@ -221,6 +235,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_OBJCPP_ARC_ABI = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -234,6 +250,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_OBJCPP_ARC_ABI = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/FavStarControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/FavStarControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..54381bc --- /dev/null +++ b/FavStarControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/UserInterfaceState.xcuserstate b/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..c9f1ed3 Binary files /dev/null and b/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/WorkspaceSettings.xcsettings b/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..bfffcfe --- /dev/null +++ b/FavStarControl.xcodeproj/project.xcworkspace/xcuserdata/bsorrentino.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/FavStarControl.xcscheme b/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/FavStarControl.xcscheme new file mode 100644 index 0000000..7094a06 --- /dev/null +++ b/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/FavStarControl.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/xcschememanagement.plist b/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d0a8856 --- /dev/null +++ b/FavStarControl.xcodeproj/xcuserdata/bsorrentino.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + FavStarControl.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 1D6058900D05DD3D006BFB54 + + primary + + + + + diff --git a/FavStarControlViewController.xib b/FavStarControlViewController.xib index 9e73836..fe6ef07 100644 --- a/FavStarControlViewController.xib +++ b/FavStarControlViewController.xib @@ -1,35 +1,38 @@ - + 784 - 9L31a - 680 - 949.54 - 353.00 - + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + YES - + IBProxyObject + IBUIView + IBUILabel YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES IBFilesOwner + IBCocoaTouchFramework IBFirstResponder + IBCocoaTouchFramework @@ -41,22 +44,69 @@ 292 {{20, 31}, {280, 21}} + + NO YES NO + IBCocoaTouchFramework Label - + 1 MCAwIDAAA 1 - 1.000000e+01 + 10 1 + + 1 + 17 + + + Helvetica + 17 + 16 + + + + + 292 + {{178, 348}, {75, 12}} + + + _NS:9 + + 1 + MSAwIDAAA + + IBCocoaTouchFramework + + + + 292 + {{120, 343}, {42, 21}} + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + Label + + + 0 + 10 + + - {320, 460} + {{0, 20}, {320, 460}} + + 3 MC43NQA @@ -66,6 +116,7 @@ NO + IBCocoaTouchFramework @@ -103,7 +154,7 @@ -1 - RmlsZSdzIE93bmVyA + File's Owner -2 @@ -116,6 +167,8 @@ YES + + @@ -124,48 +177,58 @@ + + 10 + + + + + 11 + + + YES - + YES -1.CustomClassName + -1.IBPluginDependency -2.CustomClassName - 6.IBEditorWindowLastContentRect + -2.IBPluginDependency + 10.CustomClassName + 10.IBPluginDependency + 11.IBPluginDependency 6.IBPluginDependency 8.IBPluginDependency - + YES FavStarControlViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder - {{438, 347}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + JSFavStarControl + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES - - YES - - - YES - + + YES - - YES - - - YES - + + - 9 + 11 @@ -177,16 +240,44 @@ label UILabel + + label + + label + UILabel + + IBProjectSource - Classes/FavStarControlViewController.h + ./Classes/FavStarControlViewController.h + + + + JSFavStarControl + UIControl + + IBProjectSource + ./Classes/JSFavStarControl.h 0 - FavStarControl.xcodeproj + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES 3 - 3.1 + 1181 diff --git a/JSFavStarControl.podspec b/JSFavStarControl.podspec new file mode 100644 index 0000000..eafdf6c --- /dev/null +++ b/JSFavStarControl.podspec @@ -0,0 +1,85 @@ + +# +# Be sure to run `pod spec lint JSFavStarControl.podspec' to ensure this is a +# valid spec. +# +# Remove all comments before submitting the spec. +# +Pod::Spec.new do |s| + s.name = 'JSFavStarControl' + s.version = '0.2' + s.license = 'unspecified' + s.summary = 'Forked version - A simple rating control for the iPhone' + s.homepage = 'https://github.com/bsorrentino/JSFavStarControl' + s.author = { 'bsorrentino' => ' bartolomeo.sorrentino@gmail.com', 'jasarien' => '' } + + # Specify the location from where the source should be retreived. + # + s.source = { :git => 'https://github.com/bsorrentino/JSFavStarControl.git', :tag => '0.2' } + # s.source = { :svn => 'http://EXAMPLE/JSFavStarControl/tags/1.0.0' } + # s.source = { :hg => 'http://EXAMPLE/JSFavStarControl', :revision => '1.0.0' } + + s.description = '' + + # If this Pod runs only on iOS or OS X, then specify that with one of + # these, or none if it runs on both platforms. + # + # s.platform = :osx + s.platform = :ios + + # A list of file patterns which select the source files that should be + # added to the Pods project. If the pattern is a directory then the + # path will automatically have '*.{h,m,mm,c,cpp}' appended. + # + # Alternatively, you can use the FileList class for even more control + # over the selected files. + # (See http://rake.rubyforge.org/classes/Rake/FileList.html.) + # + s.source_files = 'Classes/JSFavStarControl.{h,m}' + + # A list of resources included with the Pod. These are copied into the + # target bundle with a build phase script. + # + # Also allows the use of the FileList class like `source_files does. + # + # s.resources = "Resources/*.png" + s.resources = "*.png" + + # A list of paths to remove after installing the Pod without the + # `--no-clean' option. These can be examples, docs, and any other type + # of files that are not needed to build the Pod. + # + # *NOTE*: Never remove license and README files. + # + # Also allows the use of the FileList class like `source_files does. + # + # s.clean_path = "examples" + # s.clean_paths = "examples", "doc" + s.clean_paths = "FavStarControl.xcodeproj", "*.{xib,m,plist,pch}", "Classes/Fav*.*" + + # Specify a list of frameworks that the application needs to link + # against for this Pod to work. + # + # s.framework = 'SomeFramework' + # s.frameworks = 'SomeFramework', 'AnotherFramework' + s.frameworks = 'UIKit', 'Foundation', 'CoreGraphics' + + # Specify a list of libraries that the application needs to link + # against for this Pod to work. + # + # s.library = 'iconv' + # s.libraries = 'iconv', 'xml2' + + # If this Pod uses ARC, specify it like so. + # + s.requires_arc = true + + # If you need to specify any other build settings, add them to the + # xcconfig hash. + # + # s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' } + + # Finally, specify any Pods that this Pod depends on. + # + # s.dependency 'JSONKit', '~> 1.4' +end diff --git a/dot10x10.png b/dot10x10.png new file mode 100644 index 0000000..bb107b9 Binary files /dev/null and b/dot10x10.png differ diff --git a/dot.png b/dot20x20.png similarity index 100% rename from dot.png rename to dot20x20.png diff --git a/main.m b/main.m index 379e1f1..0524b87 100644 --- a/main.m +++ b/main.m @@ -10,8 +10,7 @@ int main(int argc, char *argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, nil); + } } diff --git a/star10x10.png b/star10x10.png new file mode 100644 index 0000000..ddbe597 Binary files /dev/null and b/star10x10.png differ diff --git a/star.png b/star20x20.png similarity index 100% rename from star.png rename to star20x20.png