├── CircleCountDown ├── en.lproj │ └── InfoPlist.strings ├── AppDelegate.h ├── CircleCountDown-Prefix.pch ├── main.m ├── DemoViewController.h ├── CircleCountDown │ ├── CircleDownCounter.h │ ├── CircleCounterView.h │ ├── CircleDownCounter.m │ └── CircleCounterView.m ├── CircleCountDown-Info.plist ├── AppDelegate.m ├── DemoViewController.m └── DemoViewController.xib ├── screenshot ├── Screenshot_1.png └── Screenshot_4.png ├── Readme.md └── CircleCountDown.xcodeproj └── project.pbxproj /CircleCountDown/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /screenshot/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pppoe/Circle-Counter-Down/HEAD/screenshot/Screenshot_1.png -------------------------------------------------------------------------------- /screenshot/Screenshot_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pppoe/Circle-Counter-Down/HEAD/screenshot/Screenshot_4.png -------------------------------------------------------------------------------- /CircleCountDown/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CircleCountDown' target in the 'CircleCountDown' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /CircleCountDown/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CircleCountDown/DemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.h 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoViewController : UIViewController 12 | 13 | @property (nonatomic, retain) IBOutlet UISegmentedControl *segControl; 14 | @property (nonatomic, retain) IBOutlet UIView *containerView; 15 | 16 | - (IBAction)buttonIntDecre:(id)sender; 17 | - (IBAction)buttonIntIncre:(id)sender; 18 | - (IBAction)buttonDecDecre:(id)sender; 19 | - (IBAction)buttonDecIncre:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # What it is 2 | You may see it elsewhere, a animated circle with a centrized counting number. 3 | 4 | # How to use it 5 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view; 6 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size; 7 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size andType:(CircleDownCounterType)type; 8 | 9 | Set the properties of the returned CircleCounterView to have more detailed customization. 10 | 11 | # How it looks like 12 | ![Appearance One](https://github.com/pppoe/Circle-Counter-Down/raw/master/screenshot/Screenshot_1.png) 13 | ![Appearance Two](https://github.com/pppoe/Circle-Counter-Down/raw/master/screenshot/Screenshot_4.png) 14 | 15 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown/CircleDownCounter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CircleDownCounter.h 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | CircleDownCounterTypeIntegerDecre = 0, //< Default 13 | CircleDownCounterTypeOneDecimalDecre, 14 | CircleDownCounterTypeIntegerIncre, 15 | CircleDownCounterTypeOneDecimalIncre 16 | } CircleDownCounterType; 17 | 18 | #define kDefaultCounterSize CGSizeMake(44,44) 19 | 20 | @class CircleCounterView; 21 | 22 | @interface CircleDownCounter : NSObject 23 | 24 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view; 25 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size; 26 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size andType:(CircleDownCounterType)type; 27 | 28 | //< Utilities 29 | + (CGRect)frameOfCircleViewOfSize:(CGSize)size inView:(UIView *)view; 30 | + (CircleCounterView *)circleViewInView:(UIView *)view; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | dev.mrpppoe.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown/CircleCounterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CircleCounterView.h 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CircleCounterView; 12 | 13 | @protocol CircleCounterViewDelegate 14 | 15 | - (void)counterDownFinished:(CircleCounterView *)circleView; 16 | 17 | @end 18 | 19 | @interface CircleCounterView : UIView { 20 | 21 | //< Different with mTimeInterval, this one decides how long a circle finished. 1 seconds by default 22 | float mCircleTimeInterval; 23 | 24 | UIColor *mNumberColor; //< Black, By Default 25 | UIFont *mNumberFont; //< Courier-Bold 20, By Default 26 | 27 | UIColor *mCircleColor; //< Black, By Default 28 | CGFloat mCircleBorderWidth; //< 6 pixels, By Default 29 | 30 | float mTimeInSeconds; //< 20, By Default 31 | float mTimeInterval; //< 1, By Default 32 | NSString *mTimeFormatString; //< For Example, @"%.0f", @"%.1f" 33 | 34 | BOOL mIsRunning; 35 | int mCircleSegs; 36 | 37 | id mDelegate; 38 | 39 | BOOL mCircleIncre; //< Default NO, the circle is drawed incrementally, otherwise decrementally 40 | } 41 | 42 | @property (nonatomic) id delegate; 43 | 44 | @property (nonatomic, assign) BOOL circleIncre; 45 | 46 | @property (nonatomic, retain) UIColor *numberColor; 47 | @property (nonatomic, retain) UIFont *numberFont; 48 | 49 | @property (nonatomic, retain) UIColor *circleColor; 50 | @property (nonatomic, assign) CGFloat circleBorderWidth; 51 | @property (nonatomic, assign) float circleTimeInterval; 52 | 53 | - (void)startWithSeconds:(float)seconds; 54 | - (void)startWithSeconds:(float)seconds andInterval:(float)interval; 55 | - (void)startWithSeconds:(float)seconds andInterval:(float)interval andTimeFormat:(NSString *)timeFormat; 56 | - (void)stop; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /CircleCountDown/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "DemoViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | @synthesize window = _window; 15 | 16 | - (void)dealloc 17 | { 18 | [_window release]; 19 | [super dealloc]; 20 | } 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 25 | 26 | DemoViewController *demoVC = [[DemoViewController alloc] initWithNibName:@"DemoViewController" bundle:nil]; 27 | self.window.rootViewController = demoVC; 28 | [demoVC release]; 29 | 30 | self.window.backgroundColor = [UIColor whiteColor]; 31 | [self.window makeKeyAndVisible]; 32 | 33 | return YES; 34 | } 35 | 36 | - (void)applicationWillResignActive:(UIApplication *)application 37 | { 38 | /* 39 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 40 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 41 | */ 42 | } 43 | 44 | - (void)applicationDidEnterBackground:(UIApplication *)application 45 | { 46 | /* 47 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 48 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | */ 50 | } 51 | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application 53 | { 54 | /* 55 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 56 | */ 57 | } 58 | 59 | - (void)applicationDidBecomeActive:(UIApplication *)application 60 | { 61 | /* 62 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 63 | */ 64 | } 65 | 66 | - (void)applicationWillTerminate:(UIApplication *)application 67 | { 68 | /* 69 | Called when the application is about to terminate. 70 | Save data if appropriate. 71 | See also applicationDidEnterBackground:. 72 | */ 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /CircleCountDown/DemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoViewController.m 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import "DemoViewController.h" 10 | #import "CircleDownCounter.h" 11 | 12 | #define kMiddleSize CGSizeMake(88, 88) 13 | #define kLargeSize CGSizeMake(120, 120) 14 | 15 | @implementation DemoViewController 16 | @synthesize segControl, containerView; 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | } 23 | return self; 24 | } 25 | 26 | - (void)didReceiveMemoryWarning 27 | { 28 | // Releases the view if it doesn't have a superview. 29 | [super didReceiveMemoryWarning]; 30 | 31 | // Release any cached data, images, etc that aren't in use. 32 | } 33 | 34 | #pragma mark - View lifecycle 35 | 36 | - (void)viewDidLoad 37 | { 38 | [super viewDidLoad]; 39 | // Do any additional setup after loading the view from its nib. 40 | } 41 | 42 | - (void)viewDidUnload 43 | { 44 | [super viewDidUnload]; 45 | 46 | self.segControl = nil; 47 | self.containerView = nil; 48 | } 49 | 50 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 51 | { 52 | // Return YES for supported orientations 53 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 54 | } 55 | 56 | - (CGSize)sizeFromSegControl { 57 | if (self.segControl.selectedSegmentIndex == 0) 58 | { 59 | return kDefaultCounterSize; 60 | } 61 | else if (self.segControl.selectedSegmentIndex == 1) 62 | { 63 | return kMiddleSize; 64 | } 65 | else 66 | { 67 | return kLargeSize; 68 | } 69 | } 70 | 71 | - (IBAction)buttonIntDecre:(id)sender { 72 | [CircleDownCounter showCircleDownWithSeconds:10.0f 73 | onView:self.containerView 74 | withSize:[self sizeFromSegControl] 75 | andType:CircleDownCounterTypeIntegerDecre]; 76 | } 77 | 78 | - (IBAction)buttonIntIncre:(id)sender { 79 | [CircleDownCounter showCircleDownWithSeconds:10.0f 80 | onView:self.containerView 81 | withSize:[self sizeFromSegControl] 82 | andType:CircleDownCounterTypeIntegerIncre]; 83 | } 84 | 85 | - (IBAction)buttonDecDecre:(id)sender { 86 | [CircleDownCounter showCircleDownWithSeconds:10.0f 87 | onView:self.containerView 88 | withSize:[self sizeFromSegControl] 89 | andType:CircleDownCounterTypeOneDecimalDecre]; 90 | } 91 | 92 | - (IBAction)buttonDecIncre:(id)sender { 93 | [CircleDownCounter showCircleDownWithSeconds:10.0f 94 | onView:self.containerView 95 | withSize:[self sizeFromSegControl] 96 | andType:CircleDownCounterTypeOneDecimalIncre]; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown/CircleDownCounter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CircleDownCounter.m 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import "CircleDownCounter.h" 10 | #import "CircleCounterView.h" 11 | 12 | static CircleDownCounter *sharedDownCounter = nil; 13 | 14 | @interface CircleDownCounter () 15 | 16 | + (CircleDownCounter *)circleDownCounter; 17 | + (void)removeCircleViewFromView:(UIView *)view; 18 | 19 | @end 20 | 21 | @implementation CircleDownCounter 22 | 23 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view { 24 | return [self showCircleDownWithSeconds:seconds onView:view 25 | withSize:kDefaultCounterSize 26 | andType:CircleDownCounterTypeIntegerDecre]; 27 | } 28 | 29 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size { 30 | return [self showCircleDownWithSeconds:seconds onView:view 31 | withSize:size 32 | andType:CircleDownCounterTypeIntegerDecre]; 33 | } 34 | 35 | + (CircleCounterView *)showCircleDownWithSeconds:(float)seconds onView:(UIView *)view withSize:(CGSize)size andType:(CircleDownCounterType)type { 36 | 37 | [self removeCircleViewFromView:view]; 38 | 39 | CircleCounterView *circleView = [[CircleCounterView alloc] initWithFrame:[self frameOfCircleViewOfSize:size 40 | inView:view]]; 41 | [view addSubview:circleView]; 42 | 43 | circleView.delegate = [self circleDownCounter]; 44 | 45 | switch (type) { 46 | case CircleDownCounterTypeIntegerDecre: 47 | [circleView startWithSeconds:seconds]; 48 | break; 49 | case CircleDownCounterTypeOneDecimalDecre: 50 | circleView.numberFont = [UIFont fontWithName:@"Courier-Bold" size:15.0f]; 51 | [circleView startWithSeconds:seconds andInterval:0.1f 52 | andTimeFormat:@"%.1f"]; 53 | break; 54 | case CircleDownCounterTypeIntegerIncre: 55 | circleView.circleIncre = YES; 56 | [circleView startWithSeconds:seconds]; 57 | break; 58 | case CircleDownCounterTypeOneDecimalIncre: 59 | circleView.circleIncre = YES; 60 | circleView.numberFont = [UIFont fontWithName:@"Courier-Bold" size:15.0f]; 61 | [circleView startWithSeconds:seconds andInterval:0.1f 62 | andTimeFormat:@"%.1f"]; 63 | break; 64 | default: 65 | break; 66 | } 67 | 68 | return circleView; 69 | } 70 | 71 | + (void)removeCircleViewFromView:(UIView *)view { 72 | CircleCounterView *circleView = [self circleViewInView:view]; 73 | if (circleView) 74 | { 75 | [circleView removeFromSuperview]; 76 | } 77 | } 78 | 79 | //< Utilities 80 | + (CGRect)frameOfCircleViewOfSize:(CGSize)size inView:(UIView *)view { 81 | return CGRectInset(view.bounds, 82 | (CGRectGetWidth(view.bounds) - size.width)/2.0f, 83 | (CGRectGetHeight(view.bounds) - size.height)/2.0f); 84 | } 85 | 86 | + (CircleCounterView *)circleViewInView:(UIView *)view { 87 | for (UIView *subView in [view subviews]) 88 | { 89 | if ([subView isKindOfClass:[CircleCounterView class]]) 90 | { 91 | return (CircleCounterView *)subView; 92 | } 93 | } 94 | return nil; 95 | } 96 | 97 | + (CircleDownCounter *)circleDownCounter { 98 | if (!sharedDownCounter) 99 | { 100 | sharedDownCounter = [[CircleDownCounter alloc] init]; 101 | } 102 | return sharedDownCounter; 103 | } 104 | 105 | #pragma mark - CircleCounterViewDelegate 106 | - (void)counterDownFinished:(CircleCounterView *)circleView { 107 | [circleView removeFromSuperview]; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /CircleCountDown/CircleCountDown/CircleCounterView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CircleCounterView.m 3 | // CircleCountDown 4 | // 5 | // Created by Haoxiang Li on 11/25/11. 6 | // Copyright (c) 2011 DEV. All rights reserved. 7 | // 8 | 9 | #import "CircleCounterView.h" 10 | 11 | #define kCircleSegs 30 12 | 13 | @interface CircleCounterView () 14 | @property (nonatomic, retain) NSString *timeFormatString; 15 | 16 | - (void)setup; 17 | - (void)update:(id)sender; 18 | - (void)updateTime:(id)sender; 19 | 20 | @end 21 | 22 | @implementation CircleCounterView 23 | @synthesize numberColor = mNumberColor; 24 | @synthesize numberFont = mNumberFont; 25 | @synthesize circleColor = mCircleColor; 26 | @synthesize circleBorderWidth = mCircleBorderWidth; 27 | @synthesize timeFormatString = mTimeFormatString; 28 | @synthesize circleIncre = mCircleIncre; 29 | @synthesize circleTimeInterval = mCircleTimeInterval; 30 | @synthesize delegate = mDelegate; 31 | 32 | - (void)awakeFromNib { 33 | [super awakeFromNib]; 34 | [self setup]; 35 | } 36 | 37 | - (id)initWithFrame:(CGRect)frame 38 | { 39 | self = [super initWithFrame:frame]; 40 | if (self) { 41 | [self setup]; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)dealloc { 47 | 48 | self.numberFont = nil; 49 | self.numberColor = nil; 50 | self.circleColor = nil; 51 | self.circleBorderWidth = 0; 52 | self.timeFormatString = nil; 53 | } 54 | 55 | - (void)drawRect:(CGRect)rect { 56 | 57 | CGContextRef context = UIGraphicsGetCurrentContext(); 58 | 59 | float radius = CGRectGetWidth(rect)/2.0f - self.circleBorderWidth/2.0f; 60 | float angleOffset = M_PI_2; 61 | 62 | CGContextSetLineWidth(context, self.circleBorderWidth); 63 | CGContextBeginPath(context); 64 | if (self.circleIncre) 65 | { 66 | CGContextAddArc(context, 67 | CGRectGetMidX(rect), CGRectGetMidY(rect), 68 | radius, 69 | -angleOffset, 70 | (mCircleSegs + 1)/(float)kCircleSegs*M_PI*2 - angleOffset, 71 | 0); 72 | } 73 | else 74 | { 75 | CGContextAddArc(context, 76 | CGRectGetMidX(rect), CGRectGetMidY(rect), 77 | radius, 78 | (mCircleSegs + 1)/(float)kCircleSegs*M_PI*2 - angleOffset, 79 | 2*M_PI - angleOffset, 80 | 0); 81 | } 82 | CGContextSetStrokeColorWithColor(context, self.circleColor.CGColor); 83 | CGContextStrokePath(context); 84 | 85 | CGContextSetLineWidth(context, 1.0f); 86 | NSString *numberText = [NSString stringWithFormat:self.timeFormatString, mTimeInSeconds]; 87 | CGSize sz = [numberText sizeWithFont:self.numberFont]; 88 | [numberText drawInRect:CGRectInset(rect, (CGRectGetWidth(rect) - sz.width)/2.0f, (CGRectGetHeight(rect) - sz.height)/2.0f) 89 | withFont:self.numberFont]; 90 | } 91 | 92 | - (void)setup { 93 | 94 | mIsRunning = NO; 95 | 96 | //< Default Parameters 97 | self.numberColor = [UIColor blackColor]; 98 | self.numberFont = [UIFont fontWithName:@"Courier-Bold" size:20.0f]; 99 | self.circleColor = [UIColor blackColor]; 100 | self.circleBorderWidth = 6; 101 | self.timeFormatString = @"%.0f"; 102 | self.circleIncre = NO; 103 | self.circleTimeInterval = 1.0f; 104 | 105 | mTimeInSeconds = 20; 106 | mTimeInterval = 1; 107 | mCircleSegs = 0; 108 | 109 | self.backgroundColor = [UIColor whiteColor]; 110 | } 111 | 112 | #pragma mark - Public Methods 113 | - (void)startWithSeconds:(float)seconds andInterval:(float)interval andTimeFormat:(NSString *)timeFormat { 114 | self.timeFormatString = timeFormat; 115 | [self startWithSeconds:seconds andInterval:interval]; 116 | } 117 | 118 | - (void)startWithSeconds:(float)seconds andInterval:(float)interval { 119 | if (interval > seconds) 120 | { 121 | mTimeInterval = seconds/10.0f; 122 | } 123 | else 124 | { 125 | mTimeInterval = interval; 126 | } 127 | [self startWithSeconds:seconds]; 128 | } 129 | 130 | - (void)startWithSeconds:(float)seconds { 131 | if (seconds > 0) 132 | { 133 | mTimeInSeconds = seconds; 134 | mIsRunning = YES; 135 | mCircleSegs = 0; 136 | [self update:nil]; 137 | [self updateTime:nil]; 138 | } 139 | } 140 | 141 | - (void)stop { 142 | mIsRunning = NO; 143 | } 144 | 145 | #pragma mark - Private Methods 146 | - (void)update:(id)sender { 147 | if (mIsRunning) 148 | { 149 | mCircleSegs = (mCircleSegs + 1) % kCircleSegs; 150 | if (fabs(mTimeInSeconds) < 1e-4) 151 | { 152 | //< Finished 153 | mCircleSegs = (kCircleSegs - 1); 154 | mTimeInSeconds = 0; 155 | [self.delegate counterDownFinished:self]; 156 | } 157 | else 158 | { 159 | [NSTimer scheduledTimerWithTimeInterval:self.circleTimeInterval/kCircleSegs 160 | target:self 161 | selector:@selector(update:) 162 | userInfo:nil 163 | repeats:NO]; 164 | } 165 | [self setNeedsDisplay]; 166 | } 167 | } 168 | 169 | - (void)updateTime:(id)sender { 170 | if (mIsRunning) 171 | { 172 | mTimeInSeconds -= mTimeInterval; 173 | if (fabs(mTimeInSeconds) < 1e-4) 174 | { 175 | //< Finished 176 | mCircleSegs = (kCircleSegs - 1); 177 | mTimeInSeconds = 0; 178 | [self.delegate counterDownFinished:self]; 179 | } 180 | else 181 | { 182 | [NSTimer scheduledTimerWithTimeInterval:mTimeInterval 183 | target:self 184 | selector:@selector(updateTime:) 185 | userInfo:nil 186 | repeats:NO]; 187 | } 188 | } 189 | } 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /CircleCountDown.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4627DBBE147F2F6000586736 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4627DBBD147F2F6000586736 /* UIKit.framework */; }; 11 | 4627DBC0147F2F6000586736 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4627DBBF147F2F6000586736 /* Foundation.framework */; }; 12 | 4627DBC2147F2F6000586736 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4627DBC1147F2F6000586736 /* CoreGraphics.framework */; }; 13 | 4627DBC8147F2F6000586736 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4627DBC6147F2F6000586736 /* InfoPlist.strings */; }; 14 | 4627DBCA147F2F6000586736 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4627DBC9147F2F6000586736 /* main.m */; }; 15 | 4627DBCE147F2F6000586736 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4627DBCD147F2F6000586736 /* AppDelegate.m */; }; 16 | 4627DBD7147F2FA800586736 /* CircleCounterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4627DBD6147F2FA800586736 /* CircleCounterView.m */; }; 17 | 4627DBDA147F3AF400586736 /* CircleDownCounter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4627DBD9147F3AF400586736 /* CircleDownCounter.m */; }; 18 | 4627DBDE147F462E00586736 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4627DBDC147F462E00586736 /* DemoViewController.m */; }; 19 | 4627DBDF147F462E00586736 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4627DBDD147F462E00586736 /* DemoViewController.xib */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 4627DBB9147F2F6000586736 /* CircleCountDown.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CircleCountDown.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 4627DBBD147F2F6000586736 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 25 | 4627DBBF147F2F6000586736 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 4627DBC1147F2F6000586736 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 27 | 4627DBC5147F2F6000586736 /* CircleCountDown-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CircleCountDown-Info.plist"; sourceTree = ""; }; 28 | 4627DBC7147F2F6000586736 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 29 | 4627DBC9147F2F6000586736 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 4627DBCB147F2F6000586736 /* CircleCountDown-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CircleCountDown-Prefix.pch"; sourceTree = ""; }; 31 | 4627DBCC147F2F6000586736 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 32 | 4627DBCD147F2F6000586736 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 33 | 4627DBD5147F2FA800586736 /* CircleCounterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleCounterView.h; sourceTree = ""; }; 34 | 4627DBD6147F2FA800586736 /* CircleCounterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleCounterView.m; sourceTree = ""; }; 35 | 4627DBD8147F3AF400586736 /* CircleDownCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleDownCounter.h; sourceTree = ""; }; 36 | 4627DBD9147F3AF400586736 /* CircleDownCounter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleDownCounter.m; sourceTree = ""; }; 37 | 4627DBDB147F462E00586736 /* DemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoViewController.h; sourceTree = ""; }; 38 | 4627DBDC147F462E00586736 /* DemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoViewController.m; sourceTree = ""; }; 39 | 4627DBDD147F462E00586736 /* DemoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DemoViewController.xib; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 4627DBB6147F2F6000586736 /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | 4627DBBE147F2F6000586736 /* UIKit.framework in Frameworks */, 48 | 4627DBC0147F2F6000586736 /* Foundation.framework in Frameworks */, 49 | 4627DBC2147F2F6000586736 /* CoreGraphics.framework in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 4627DBAE147F2F6000586736 = { 57 | isa = PBXGroup; 58 | children = ( 59 | 4627DBD4147F2F7700586736 /* CircleCountDown */, 60 | 4627DBC3147F2F6000586736 /* CircleCountDownDemo */, 61 | 4627DBBC147F2F6000586736 /* Frameworks */, 62 | 4627DBBA147F2F6000586736 /* Products */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 4627DBBA147F2F6000586736 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 4627DBB9147F2F6000586736 /* CircleCountDown.app */, 70 | ); 71 | name = Products; 72 | sourceTree = ""; 73 | }; 74 | 4627DBBC147F2F6000586736 /* Frameworks */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 4627DBBD147F2F6000586736 /* UIKit.framework */, 78 | 4627DBBF147F2F6000586736 /* Foundation.framework */, 79 | 4627DBC1147F2F6000586736 /* CoreGraphics.framework */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 4627DBC3147F2F6000586736 /* CircleCountDownDemo */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 4627DBCC147F2F6000586736 /* AppDelegate.h */, 88 | 4627DBCD147F2F6000586736 /* AppDelegate.m */, 89 | 4627DBC4147F2F6000586736 /* Supporting Files */, 90 | 4627DBDB147F462E00586736 /* DemoViewController.h */, 91 | 4627DBDC147F462E00586736 /* DemoViewController.m */, 92 | 4627DBDD147F462E00586736 /* DemoViewController.xib */, 93 | ); 94 | name = CircleCountDownDemo; 95 | path = CircleCountDown; 96 | sourceTree = ""; 97 | }; 98 | 4627DBC4147F2F6000586736 /* Supporting Files */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 4627DBC5147F2F6000586736 /* CircleCountDown-Info.plist */, 102 | 4627DBC6147F2F6000586736 /* InfoPlist.strings */, 103 | 4627DBC9147F2F6000586736 /* main.m */, 104 | 4627DBCB147F2F6000586736 /* CircleCountDown-Prefix.pch */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | 4627DBD4147F2F7700586736 /* CircleCountDown */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 4627DBD5147F2FA800586736 /* CircleCounterView.h */, 113 | 4627DBD6147F2FA800586736 /* CircleCounterView.m */, 114 | 4627DBD8147F3AF400586736 /* CircleDownCounter.h */, 115 | 4627DBD9147F3AF400586736 /* CircleDownCounter.m */, 116 | ); 117 | name = CircleCountDown; 118 | path = CircleCountDown/CircleCountDown; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 4627DBB8147F2F6000586736 /* CircleCountDown */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 4627DBD1147F2F6000586736 /* Build configuration list for PBXNativeTarget "CircleCountDown" */; 127 | buildPhases = ( 128 | 4627DBB5147F2F6000586736 /* Sources */, 129 | 4627DBB6147F2F6000586736 /* Frameworks */, 130 | 4627DBB7147F2F6000586736 /* Resources */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | ); 136 | name = CircleCountDown; 137 | productName = CircleCountDown; 138 | productReference = 4627DBB9147F2F6000586736 /* CircleCountDown.app */; 139 | productType = "com.apple.product-type.application"; 140 | }; 141 | /* End PBXNativeTarget section */ 142 | 143 | /* Begin PBXProject section */ 144 | 4627DBB0147F2F6000586736 /* Project object */ = { 145 | isa = PBXProject; 146 | attributes = { 147 | LastUpgradeCheck = 0420; 148 | ORGANIZATIONNAME = DEV; 149 | }; 150 | buildConfigurationList = 4627DBB3147F2F6000586736 /* Build configuration list for PBXProject "CircleCountDown" */; 151 | compatibilityVersion = "Xcode 3.2"; 152 | developmentRegion = English; 153 | hasScannedForEncodings = 0; 154 | knownRegions = ( 155 | en, 156 | ); 157 | mainGroup = 4627DBAE147F2F6000586736; 158 | productRefGroup = 4627DBBA147F2F6000586736 /* Products */; 159 | projectDirPath = ""; 160 | projectRoot = ""; 161 | targets = ( 162 | 4627DBB8147F2F6000586736 /* CircleCountDown */, 163 | ); 164 | }; 165 | /* End PBXProject section */ 166 | 167 | /* Begin PBXResourcesBuildPhase section */ 168 | 4627DBB7147F2F6000586736 /* Resources */ = { 169 | isa = PBXResourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | 4627DBC8147F2F6000586736 /* InfoPlist.strings in Resources */, 173 | 4627DBDF147F462E00586736 /* DemoViewController.xib in Resources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXResourcesBuildPhase section */ 178 | 179 | /* Begin PBXSourcesBuildPhase section */ 180 | 4627DBB5147F2F6000586736 /* Sources */ = { 181 | isa = PBXSourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 4627DBCA147F2F6000586736 /* main.m in Sources */, 185 | 4627DBCE147F2F6000586736 /* AppDelegate.m in Sources */, 186 | 4627DBD7147F2FA800586736 /* CircleCounterView.m in Sources */, 187 | 4627DBDA147F3AF400586736 /* CircleDownCounter.m in Sources */, 188 | 4627DBDE147F462E00586736 /* DemoViewController.m in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin PBXVariantGroup section */ 195 | 4627DBC6147F2F6000586736 /* InfoPlist.strings */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 4627DBC7147F2F6000586736 /* en */, 199 | ); 200 | name = InfoPlist.strings; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | 4627DBCF147F2F6000586736 /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 211 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 212 | COPY_PHASE_STRIP = NO; 213 | GCC_C_LANGUAGE_STANDARD = gnu99; 214 | GCC_DYNAMIC_NO_PIC = NO; 215 | GCC_OPTIMIZATION_LEVEL = 0; 216 | GCC_PREPROCESSOR_DEFINITIONS = ( 217 | "DEBUG=1", 218 | "$(inherited)", 219 | ); 220 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 221 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 222 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 224 | GCC_WARN_UNUSED_VARIABLE = YES; 225 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 226 | SDKROOT = iphoneos; 227 | }; 228 | name = Debug; 229 | }; 230 | 4627DBD0147F2F6000586736 /* Release */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 235 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 236 | COPY_PHASE_STRIP = YES; 237 | GCC_C_LANGUAGE_STANDARD = gnu99; 238 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 239 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 240 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 243 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 244 | SDKROOT = iphoneos; 245 | VALIDATE_PRODUCT = YES; 246 | }; 247 | name = Release; 248 | }; 249 | 4627DBD2147F2F6000586736 /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 253 | GCC_PREFIX_HEADER = "CircleCountDown/CircleCountDown-Prefix.pch"; 254 | INFOPLIST_FILE = "CircleCountDown/CircleCountDown-Info.plist"; 255 | PRODUCT_NAME = "$(TARGET_NAME)"; 256 | WRAPPER_EXTENSION = app; 257 | }; 258 | name = Debug; 259 | }; 260 | 4627DBD3147F2F6000586736 /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 264 | GCC_PREFIX_HEADER = "CircleCountDown/CircleCountDown-Prefix.pch"; 265 | INFOPLIST_FILE = "CircleCountDown/CircleCountDown-Info.plist"; 266 | PRODUCT_NAME = "$(TARGET_NAME)"; 267 | WRAPPER_EXTENSION = app; 268 | }; 269 | name = Release; 270 | }; 271 | /* End XCBuildConfiguration section */ 272 | 273 | /* Begin XCConfigurationList section */ 274 | 4627DBB3147F2F6000586736 /* Build configuration list for PBXProject "CircleCountDown" */ = { 275 | isa = XCConfigurationList; 276 | buildConfigurations = ( 277 | 4627DBCF147F2F6000586736 /* Debug */, 278 | 4627DBD0147F2F6000586736 /* Release */, 279 | ); 280 | defaultConfigurationIsVisible = 0; 281 | defaultConfigurationName = Release; 282 | }; 283 | 4627DBD1147F2F6000586736 /* Build configuration list for PBXNativeTarget "CircleCountDown" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | 4627DBD2147F2F6000586736 /* Debug */, 287 | 4627DBD3147F2F6000586736 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | }; 291 | /* End XCConfigurationList section */ 292 | }; 293 | rootObject = 4627DBB0147F2F6000586736 /* Project object */; 294 | } 295 | -------------------------------------------------------------------------------- /CircleCountDown/DemoViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 10K540 6 | 1938 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBUIButton 15 | IBUISegmentedControl 16 | IBUIView 17 | IBProxyObject 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 292 42 | {{20, 14}, {120, 37}} 43 | 44 | 45 | 46 | NO 47 | IBCocoaTouchFramework 48 | 0 49 | 0 50 | 1 51 | Int Decre 52 | 53 | 3 54 | MQA 55 | 56 | 57 | 1 58 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 59 | 60 | 61 | 3 62 | MC41AA 63 | 64 | 65 | 2 66 | 15 67 | 68 | 69 | Helvetica-Bold 70 | 15 71 | 16 72 | 73 | 74 | 75 | 76 | 292 77 | {{180, 14}, {120, 37}} 78 | 79 | 80 | 81 | NO 82 | IBCocoaTouchFramework 83 | 0 84 | 0 85 | 1 86 | Dec Decre 87 | 88 | 89 | 1 90 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 292 99 | {{20, 67}, {120, 37}} 100 | 101 | 102 | 103 | NO 104 | IBCocoaTouchFramework 105 | 0 106 | 0 107 | 1 108 | Int Incre 109 | 110 | 111 | 1 112 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 292 121 | {{180, 67}, {120, 37}} 122 | 123 | 124 | 125 | NO 126 | IBCocoaTouchFramework 127 | 0 128 | 0 129 | 1 130 | Dec Incre 131 | 132 | 133 | 1 134 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 292 143 | {{20, 180}, {280, 260}} 144 | 145 | 146 | 147 | 148 | 3 149 | MQA 150 | 151 | 2 152 | 153 | 154 | IBCocoaTouchFramework 155 | 156 | 157 | 158 | 292 159 | {{44, 118}, {233, 44}} 160 | 161 | 162 | 163 | NO 164 | IBCocoaTouchFramework 165 | 3 166 | 0 167 | 168 | Default 169 | Middle 170 | Large 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | {0, 0} 184 | {0, 0} 185 | {0, 0} 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | {{0, 20}, {320, 460}} 195 | 196 | 197 | 198 | 199 | 3 200 | MQA 201 | 202 | 203 | 204 | IBCocoaTouchFramework 205 | 206 | 207 | 208 | 209 | 210 | 211 | view 212 | 213 | 214 | 215 | 3 216 | 217 | 218 | 219 | segControl 220 | 221 | 222 | 223 | 11 224 | 225 | 226 | 227 | containerView 228 | 229 | 230 | 231 | 12 232 | 233 | 234 | 235 | buttonIntDecre: 236 | 237 | 238 | 7 239 | 240 | 14 241 | 242 | 243 | 244 | buttonDecDecre: 245 | 246 | 247 | 7 248 | 249 | 15 250 | 251 | 252 | 253 | buttonIntIncre: 254 | 255 | 256 | 7 257 | 258 | 16 259 | 260 | 261 | 262 | buttonDecIncre: 263 | 264 | 265 | 7 266 | 267 | 17 268 | 269 | 270 | 271 | 272 | 273 | 0 274 | 275 | 276 | 277 | 278 | 279 | 1 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | -1 293 | 294 | 295 | File's Owner 296 | 297 | 298 | -2 299 | 300 | 301 | 302 | 303 | 4 304 | 305 | 306 | 307 | 308 | 6 309 | 310 | 311 | 312 | 313 | 7 314 | 315 | 316 | 317 | 318 | 8 319 | 320 | 321 | 322 | 323 | 9 324 | 325 | 326 | Counter Container 327 | 328 | 329 | 10 330 | 331 | 332 | 333 | 334 | 335 | 336 | DemoViewController 337 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 338 | UIResponder 339 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 340 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 341 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 342 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 343 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 344 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 345 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 346 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 347 | 348 | 349 | 350 | 351 | 352 | 17 353 | 354 | 355 | 356 | 357 | DemoViewController 358 | UIViewController 359 | 360 | id 361 | id 362 | id 363 | id 364 | 365 | 366 | 367 | buttonDecDecre: 368 | id 369 | 370 | 371 | buttonDecIncre: 372 | id 373 | 374 | 375 | buttonIntDecre: 376 | id 377 | 378 | 379 | buttonIntIncre: 380 | id 381 | 382 | 383 | 384 | UIView 385 | UISegmentedControl 386 | 387 | 388 | 389 | containerView 390 | UIView 391 | 392 | 393 | segControl 394 | UISegmentedControl 395 | 396 | 397 | 398 | IBProjectSource 399 | ./Classes/DemoViewController.h 400 | 401 | 402 | 403 | 404 | 0 405 | IBCocoaTouchFramework 406 | YES 407 | 3 408 | 933 409 | 410 | 411 | --------------------------------------------------------------------------------