Permalink
Browse files

- ARC support

- added LICENSE
- cleaned up code
  • Loading branch information...
1 parent 4fd1119 commit 2a2699423581438bd25241721cfe4b832f112cd6 @honcheng committed Aug 12, 2012
View
@@ -0,0 +1,3 @@
+SliderPageControlDemo/SliderPageControlDemo.xcodeproj/project.xcworkspace/xcuserdata/honcheng.xcuserdatad/UserInterfaceState.xcuserstate
+SliderPageControlDemo/SliderPageControlDemo.xcodeproj/xcuserdata/honcheng.xcuserdatad/xcschemes/SliderPageControlDemo.xcscheme
+SliderPageControlDemo/SliderPageControlDemo.xcodeproj/xcuserdata/honcheng.xcuserdatad/xcschemes/xcschememanagement.plist
View
@@ -0,0 +1,27 @@
+Copyright (c) 2012 Muh Hon Cheng
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
+WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+@author Muh Hon Cheng <honcheng@gmail.com>
+@copyright 2012 Muh Hon Cheng
View
@@ -1,30 +0,0 @@
-SliderPageControl for iOS
-
-This is an alternative for UIPageControl
-
-REQUIRED FILES
-1. SliderPageControl.h
-2. SliderPageControl.m
-3. SliderPageControl.bundle/images/sliderPageControl.png
-4. SliderPageControl.bundle/images/sliderPageControlBg.png
-
-INSTRUCTIONS
-To integrate SliderPageControl, drag the files above to your XCode Project, and add to your view.
-
-- (void)setNumberOfPages:(int)page
-* set number of pages
-
-- (int)currentPage
-* returns the current page
-
-- (void)setCurrentPage:(int)_currentPage animated:(BOOL)animated
-* set the current page. set animated=YES to animate the control
-
-- (NSString *)sliderPageController:(id)controller hintTitleForPage:(NSInteger)page
-* set page title that is visible when the control is dragged
-
-SKINNING SLIDERPAGECONTROL
-To skin SliderPageControl, use the provided PSD file to change the control image (sliderPageControl.png) and the background (sliderPageControlBg.png)
-
-You can find more information about SliderPageControl at the link below
-http://www.honcheng.com/2010/12/SliderPageControl---open-source-alternative-for-UIPageControl-in-iOS
View
@@ -0,0 +1,50 @@
+SliderPageControl for iOS
+=========================
+
+This is an alternative for UIPageControl. See video [here](http://www.honcheng.com/2010/12/SliderPageControl---open-source-alternative-for-UIPageControl-in-iOS)
+
+Required Files
+--------------
+1. SliderPageControl.h
+2. SliderPageControl.m
+3. SliderPageControl.bundle/images/sliderPageControl.png
+4. SliderPageControl.bundle/images/sliderPageControlBg.png
+
+Usage
+-----
+
+1) To integrate SliderPageControl, drag the files above to your XCode Project, and add to your view.
+
+ #import SliderPageControl.h
+
+2) set number of pages
+
+ - (void)setNumberOfPages:(int)page
+
+3) returns the current page
+
+ - (int)currentPage
+
+4) set the current page. set animated=YES to animate the control
+
+ - (void)setCurrentPage:(int)_currentPage animated:(BOOL)animated
+
+5) set page title that is visible when the control is dragged
+
+ - (NSString *)sliderPageController:(id)controller hintTitleForPage:(NSInteger)page
+
+6) Skinning SliderPageControl
+To skin SliderPageControl, use the provided PSD file to change the control image (sliderPageControl.png) and the background (sliderPageControlBg.png)
+
+You can find more information about SliderPageControl at the link below
+
+Requirements
+------------
+* ARC
+* XCode 4.4 (auto-synthesis)
+
+Contact
+-------
+
+[@honcheng](http://twitter.com/honcheng)
+[honcheng.com](http://honcheng.com)
@@ -40,26 +40,16 @@
@end
-@interface SliderPageControl : UIControl {
- UIImageView *backgroundView;
- int numberOfPages;
- int currentPage;
- UIImageView *slider;
- CGPoint beganPoint;
- BOOL hasDragged;
- UIView *maskView;
- UILabel *hintLabel;
- id<SliderPageControlDelegate> delegate;
- BOOL showsHint;
-}
+@interface SliderPageControl : UIControl
+@property (nonatomic, unsafe_unretained) id<SliderPageControlDelegate> delegate;
+@property (nonatomic, assign) BOOL showsHint, hasDragged;
+@property (nonatomic, strong) UIImageView *backgroundView;
+@property (nonatomic, strong) UIImageView *slider;
+@property (nonatomic, assign) int numberOfPages, currentPage;
+@property (nonatomic, assign) CGPoint beganPoint;
+@property (nonatomic, strong) UIView *maskView;
+@property (nonatomic, strong) UILabel *hintLabel;
-@property (nonatomic, retain) id<SliderPageControlDelegate> delegate;
-@property (nonatomic, assign) BOOL showsHint;
-@property (nonatomic, retain) UIImageView *backgroundView;
-@property (nonatomic, retain) UIImageView *slider;
-
-- (void)setNumberOfPages:(int)page;
-- (int)currentPage;
- (void)setCurrentPage:(int)_currentPage animated:(BOOL)animated;
@end
Oops, something went wrong.

0 comments on commit 2a26994

Please sign in to comment.