├── Image └── Demo.png ├── .gitignore ├── Demo.xcodeproj ├── xcuserdata │ ├── ant.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── aoliday.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── Demo.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── aoliday.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── Demo.xccheckout └── project.pbxproj ├── Demo ├── ViewController.h ├── AppDelegate.h ├── main.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ViewController.m ├── AppDelegate.m └── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── README.md ├── DemoTests ├── Info.plist └── DemoTests.m ├── LICENSE ├── CountDownView ├── ZQCountDownView.h └── ZQCountDownView.m └── ZQCountDownView.podspec /Image/Demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockefellerZQ/CountDownView/HEAD/Image/Demo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */.DS_Store 2 | .DS_Store 3 | */.svn 4 | */.svn/* 5 | Demo.xcodeproj/project.xcworkspace/xcuserdata/* 6 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/ant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/aoliday.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.xcworkspace/xcuserdata/aoliday.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RockefellerZQ/CountDownView/HEAD/Demo.xcodeproj/project.xcworkspace/xcuserdata/aoliday.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Demo 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##一个简单的iOS倒计时控件 2 | ![Demo Image](https://raw.githubusercontent.com/RockefellerZQ/CountDownView/master/Image/Demo.png) 3 | 4 | ####初始化 5 | 将ZQCountDownView添加到你的项目工程,然后可以通过代码或者xib的形式进行初始化 6 | 7 | ```` 8 | _recoderTimeIntervalDidInBackground = YES 9 | ```` 10 | 11 | _recoderTimeIntervalDidInBackground等于YES的时候,应用程序进入后台会记录当前剩余的倒计时和进入后台的时间,当应用程序再次进入前台时倒计时会减掉中间的时间差。(程序进入后台一段时间后,定时器会暂停计时) 12 | 13 | ####pod 安装 14 | pod 'ZQCountDownView', '~> 0.0.1' 15 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/ant.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/aoliday.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DF6074ED1B70934B00E27133 16 | 17 | primary 18 | 19 | 20 | DF6075061B70934B00E27133 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | aoliday.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DemoTests/DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTests.m 3 | // DemoTests 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface DemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation DemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [2015] [Ant] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CountDownView/ZQCountDownView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZQCountDownView.h 3 | // ZQCountDownView 4 | // 5 | // Created by aoliday on 15/7/7. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZQCountDownViewDelegate; 12 | @interface ZQCountDownView : UIView 13 | 14 | // 剩余的秒数 15 | @property (nonatomic, assign) NSTimeInterval countDownTimeInterval; 16 | 17 | // 倒计时文字的颜色 18 | @property (nonatomic) UIColor *textColor; 19 | 20 | // 倒计时label的背景色 21 | @property (nonatomic) UIColor *themeColor; 22 | 23 | // 显示时间的冒号的字体颜色 24 | @property (nonatomic) UIColor *colonColor; 25 | 26 | // 倒计时label的字体 27 | @property (nonatomic) UIFont *textFont; 28 | 29 | @property (nonatomic) UIColor *labelBorderColor; 30 | 31 | // 是否圆角 default NO 32 | @property (nonatomic, assign) BOOL circularCorner; 33 | 34 | @property (nonatomic, weak) id delegate; 35 | 36 | // 默认为NO,当进入后台一段时间后定时器将会暂停及时,再次 37 | // 回到前台才会启动,设置为YES时弥补这种状态 如果用户更改系统时间的话,此方法不适用 38 | @property (nonatomic, assign) BOOL recoderTimeIntervalDidInBackground; 39 | 40 | - (void)stopCountDown; 41 | 42 | @end 43 | 44 | @protocol ZQCountDownViewDelegate 45 | 46 | - (void)countDownDidFinished; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | aoliday.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Demo 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ZQCountDownView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet ZQCountDownView *countDownView; 14 | @property (weak, nonatomic) IBOutlet ZQCountDownView *countDownView1; 15 | @property (weak, nonatomic) IBOutlet ZQCountDownView *countDownView2; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | _countDownView.circularCorner = YES; 24 | _countDownView.themeColor = [UIColor orangeColor]; 25 | _countDownView.countDownTimeInterval = 2000; 26 | _countDownView.recoderTimeIntervalDidInBackground = YES; 27 | 28 | _countDownView1.themeColor = [UIColor magentaColor]; 29 | _countDownView1.textColor = [UIColor whiteColor]; 30 | _countDownView1.textFont = [UIFont systemFontOfSize:18]; 31 | _countDownView1.countDownTimeInterval = 3000; 32 | 33 | _countDownView2.themeColor = [UIColor whiteColor]; 34 | _countDownView2.textColor = [UIColor darkGrayColor]; 35 | _countDownView2.textFont = [UIFont boldSystemFontOfSize:20]; 36 | _countDownView2.colonColor = [UIColor whiteColor]; 37 | _countDownView2.countDownTimeInterval = 4000; 38 | // Do any additional setup after loading the view, typically from a nib. 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Demo 4 | // 5 | // Created by aoliday on 15/8/4. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.xcworkspace/xcshareddata/Demo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | D214E3DB-CD38-4DFF-96C6-11658396B23F 9 | IDESourceControlProjectName 10 | Demo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 36913AE66289885052E9AE32E9C49828F88B465A 14 | https://github.com/RockefellerZQ/ZQCountDownView.git 15 | 6B8E935A2A61470A5A3A0CC3D800578732467DB0 16 | https://github.com/RockefellerZQ/CountDownView.git 17 | 18 | IDESourceControlProjectPath 19 | Demo.xcodeproj 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 36913AE66289885052E9AE32E9C49828F88B465A 23 | ../..CountDownView/ 24 | 6B8E935A2A61470A5A3A0CC3D800578732467DB0 25 | ../.. 26 | 27 | IDESourceControlProjectURL 28 | https://github.com/RockefellerZQ/CountDownView.git 29 | IDESourceControlProjectVersion 30 | 111 31 | IDESourceControlProjectWCCIdentifier 32 | 6B8E935A2A61470A5A3A0CC3D800578732467DB0 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 6B8E935A2A61470A5A3A0CC3D800578732467DB0 40 | IDESourceControlWCCName 41 | CountDownView 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 36913AE66289885052E9AE32E9C49828F88B465A 48 | IDESourceControlWCCName 49 | CountDownView 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Demo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo.xcodeproj/xcuserdata/aoliday.xcuserdatad/xcschemes/Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ZQCountDownView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint ZQCountDownView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "ZQCountDownView" 19 | s.version = "1.0.4" 20 | s.summary = "倒计时控件" 21 | 22 | s.description = <<-DESC 23 | ##一个简单的iOS倒计时控件 24 | 25 | ####初始化 26 | 将ZQCountDownView添加到你的项目工程,然后可以通过代码或者xib的形式进行初始化 27 | 28 | ```` 29 | _recoderTimeIntervalDidInBackground = YES 30 | ```` 31 | 32 | _recoderTimeIntervalDidInBackground等于YES的时候,应用程序进入后台会记录当前剩余的倒计时和进入后台的时间,当应用程序再次进入前台时倒计时会减掉中间的时间差。(程序进入后台一段时间后,定时器会暂停计时) 33 | 34 | DESC 35 | 36 | s.homepage = "https://github.com/RockefellerZQ/CountDownView" 37 | s.screenshots = "https://raw.githubusercontent.com/RockefellerZQ/CountDownView/master/Image/Demo.png" 38 | 39 | 40 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 41 | # 42 | # Licensing your code is important. See http://choosealicense.com for more info. 43 | # CocoaPods will detect a license file if there is a named LICENSE* 44 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 45 | # 46 | 47 | # s.license = "MIT (example)" 48 | s.license = { :type => "MIT", :file => "./LICENSE" } 49 | 50 | 51 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 52 | # 53 | # Specify the authors of the library, with email addresses. Email addresses 54 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 55 | # accepts just a name if you'd rather not provide an email address. 56 | # 57 | # Specify a social_media_url where others can refer to, for example a twitter 58 | # profile URL. 59 | # 60 | 61 | s.author = { "name" => "rockefeller", "email" => "rockefeller.zq@gmail.com"} 62 | # Or just: s.author = "" 63 | # s.authors = { "" => "" } 64 | # s.social_media_url = "http://twitter.com/" 65 | 66 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 67 | # 68 | # If this Pod runs only on iOS or OS X, then specify the platform and 69 | # the deployment target. You can optionally include the target after the platform. 70 | # 71 | 72 | s.platform = :ios 73 | s.platform = :ios, "6.0" 74 | 75 | # When using multiple platforms 76 | s.ios.deployment_target = "6.0" 77 | # s.osx.deployment_target = "10.7" 78 | # s.watchos.deployment_target = "2.0" 79 | 80 | 81 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 82 | # 83 | # Specify the location from where the source should be retrieved. 84 | # Supports git, hg, bzr, svn and HTTP. 85 | # 86 | 87 | s.source = { :git => "https://github.com/RockefellerZQ/CountDownView.git", :tag => s.version.to_s } 88 | 89 | 90 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 91 | # 92 | # CocoaPods is smart about how it includes source code. For source files 93 | # giving a folder will include any swift, h, m, mm, c & cpp files. 94 | # For header files it will include any header in the folder. 95 | # Not including the public_header_files will make all headers public. 96 | # 97 | 98 | s.source_files = "Classes", "CountDownView/**/*.{h,m}" 99 | s.exclude_files = "Classes/Exclude" 100 | 101 | # s.public_header_files = "Classes/**/*.h" 102 | 103 | 104 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 105 | # 106 | # A list of resources included with the Pod. These are copied into the 107 | # target bundle with a build phase script. Anything else will be cleaned. 108 | # You can preserve files from being cleaned, please don't preserve 109 | # non-essential files like tests, examples and documentation. 110 | # 111 | 112 | # s.resource = "icon.png" 113 | # s.resources = "Resources/*.png" 114 | 115 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 116 | 117 | 118 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 119 | # 120 | # Link your library with frameworks, or libraries. Libraries do not include 121 | # the lib prefix of their name. 122 | # 123 | 124 | # s.framework = "SomeFramework" 125 | # s.frameworks = "SomeFramework", "AnotherFramework" 126 | 127 | # s.library = "iconv" 128 | # s.libraries = "iconv", "xml2" 129 | 130 | 131 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 132 | # 133 | # If your library depends on compiler flags you can set them in the xcconfig hash 134 | # where they will only apply to your library. If you depend on other Podspecs 135 | # you can include multiple dependencies to ensure it works. 136 | 137 | s.requires_arc = true 138 | 139 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 140 | # s.dependency "JSONKit", "~> 1.4" 141 | 142 | end 143 | -------------------------------------------------------------------------------- /CountDownView/ZQCountDownView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZQCountDownView.m 3 | // ZQCountDownView 4 | // 5 | // Created by aoliday on 15/7/7. 6 | // Copyright (c) 2015年 aoliday. All rights reserved. 7 | // 8 | 9 | #import "ZQCountDownView.h" 10 | 11 | @interface ZQCountDownView () 12 | 13 | //显示小时 14 | @property (nonatomic) UILabel *hourLabel; 15 | // 显示分钟 16 | @property (nonatomic) UILabel *minuteLabel; 17 | // 显示秒 18 | @property (nonatomic) UILabel *secondLabel; 19 | 20 | // 显示时间的冒号集合, 可以更改这个集合内冒号的颜色, 字体等 21 | @property (nonatomic) NSArray *colonsArray; 22 | 23 | @property (nonatomic) NSTimer *timer; 24 | // 用于展示的秒, 分钟, 小时 25 | @property (nonatomic, assign) int hour; 26 | @property (nonatomic, assign) int minute; 27 | @property (nonatomic, assign) int second; 28 | 29 | @property (nonatomic, assign) BOOL didRegisterNotificaton; 30 | 31 | // 进入后台时since 1970的秒数 32 | @property (nonatomic, assign) NSTimeInterval endBackgroundTimeInterval; 33 | // 当前倒计时剩余秒数 34 | @property (nonatomic, assign) NSTimeInterval countDownLeftTimeInterval; 35 | 36 | 37 | // 设置小时重新设置label的frame,小时默认两位数,可能超过两位数 38 | - (void)setHourText:(NSString *)hour; 39 | 40 | @end 41 | 42 | @implementation ZQCountDownView 43 | 44 | - (instancetype)initWithFrame:(CGRect)frame 45 | { 46 | self = [super initWithFrame:frame]; 47 | if (self) { 48 | [self initializeValues]; 49 | } 50 | return self; 51 | } 52 | 53 | - (instancetype)initWithCoder:(NSCoder *)coder 54 | { 55 | self = [super initWithCoder:coder]; 56 | if (self) { 57 | [self initializeValues]; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)initializeValues 63 | { 64 | _themeColor = [UIColor clearColor]; 65 | _colonColor = [UIColor darkTextColor]; 66 | _textColor = [UIColor darkTextColor]; 67 | _textFont = [UIFont systemFontOfSize:14.0]; 68 | _recoderTimeIntervalDidInBackground = NO; 69 | _didRegisterNotificaton = NO; 70 | self.backgroundColor = [UIColor clearColor]; 71 | } 72 | 73 | - (void)setFrame:(CGRect)frame 74 | { 75 | [super setFrame:frame]; 76 | [self adjustSubViewsWithFrame:frame]; 77 | } 78 | 79 | - (void)setRecoderTimeIntervalDidInBackground:(BOOL)recoderTimeIntervalDidInBackground 80 | { 81 | _recoderTimeIntervalDidInBackground = recoderTimeIntervalDidInBackground; 82 | if (recoderTimeIntervalDidInBackground) 83 | { 84 | [self observeNotification]; 85 | } 86 | 87 | if (!recoderTimeIntervalDidInBackground && _didRegisterNotificaton) 88 | { 89 | [self removeObservers]; 90 | } 91 | } 92 | 93 | /** 94 | * 调整时分秒的frame 95 | * 96 | */ 97 | - (void)adjustSubViewsWithFrame:(CGRect)frame 98 | { 99 | if (!self.hourLabel.superview) 100 | { 101 | [self addSubview:self.hourLabel]; 102 | } 103 | 104 | if (!self.minuteLabel.superview) 105 | { 106 | [self addSubview:self.minuteLabel]; 107 | } 108 | 109 | if (!self.secondLabel.superview) 110 | { 111 | [self addSubview:self.secondLabel]; 112 | } 113 | 114 | [_hourLabel sizeToFit]; 115 | CGFloat hourLabelWidth = _hourLabel.frame.size.width; 116 | CGFloat width = frame.size.width; 117 | CGFloat colonWidth = 8.0; 118 | CGFloat itemWidth = (width - colonWidth * 2) / 3; 119 | if (hourLabelWidth < itemWidth) 120 | { 121 | hourLabelWidth = itemWidth; 122 | } 123 | itemWidth = (width - hourLabelWidth - colonWidth * 2) / 2; 124 | CGFloat itemHeight = frame.size.height; 125 | 126 | // 如果存在colon view的话先将colon view 移除当前视图 127 | if (_colonsArray.count > 0) 128 | { 129 | for (UIView *subView in _colonsArray) 130 | { 131 | [subView removeFromSuperview]; 132 | } 133 | } 134 | 135 | if (_circularCorner) { 136 | if (hourLabelWidth > itemWidth) { 137 | hourLabelWidth = itemWidth; 138 | } 139 | if (itemWidth > itemHeight) { 140 | hourLabelWidth = itemHeight; 141 | itemWidth = itemHeight; 142 | } else { 143 | itemHeight = itemWidth; 144 | } 145 | _hourLabel.layer.cornerRadius = itemWidth/2.0; 146 | _minuteLabel.layer.cornerRadius = itemWidth/2.0; 147 | _secondLabel.layer.cornerRadius = itemWidth/2.0; 148 | } 149 | _hourLabel.frame = CGRectMake(0, 0, hourLabelWidth, itemHeight); 150 | _minuteLabel.frame = CGRectMake(CGRectGetMaxX(_hourLabel.frame) + colonWidth, 0, itemWidth, itemHeight); 151 | _secondLabel.frame = CGRectMake(CGRectGetMaxX(_minuteLabel.frame) + colonWidth, 0, itemWidth, itemHeight); 152 | 153 | UILabel *colonOne = [[UILabel alloc] initWithFrame:CGRectMake(hourLabelWidth, 0, colonWidth, itemHeight)]; 154 | colonOne.text = @":"; 155 | colonOne.backgroundColor = [UIColor clearColor]; 156 | colonOne.textColor = _colonColor; 157 | colonOne.font = _textFont; 158 | colonOne.textAlignment = NSTextAlignmentCenter; 159 | [self addSubview:colonOne]; 160 | 161 | UILabel *colonTwo = [[UILabel alloc] initWithFrame:CGRectMake(hourLabelWidth + itemWidth + colonWidth, 0, colonWidth, itemHeight)]; 162 | colonTwo.text = @":"; 163 | colonTwo.backgroundColor = [UIColor clearColor]; 164 | colonTwo.textColor = _colonColor; 165 | colonTwo.font = _textFont; 166 | colonTwo.textAlignment = NSTextAlignmentCenter; 167 | [self addSubview:colonTwo]; 168 | 169 | _colonsArray = @[colonOne, colonTwo]; 170 | colonOne = nil; 171 | colonTwo = nil; 172 | } 173 | 174 | - (void)setHourText:(NSString *)hour 175 | { 176 | NSInteger texeLength = _hourLabel.text.length; 177 | _hourLabel.text = hour; 178 | if (texeLength != _hourLabel.text.length) 179 | { 180 | [self adjustSubViewsWithFrame:self.frame]; 181 | } 182 | } 183 | 184 | - (void)setCircularCorner:(BOOL)circularCorner 185 | { 186 | if (_circularCorner != circularCorner) { 187 | _circularCorner = circularCorner; 188 | [self adjustSubViewsWithFrame:self.frame]; 189 | } 190 | } 191 | 192 | #pragma mark init subviews 193 | - (UILabel *)hourLabel 194 | { 195 | if (!_hourLabel) 196 | { 197 | _hourLabel = [UILabel new]; 198 | _hourLabel.textAlignment = NSTextAlignmentCenter; 199 | _hourLabel.backgroundColor = _themeColor; 200 | _hourLabel.textColor = _textColor; 201 | _hourLabel.font = _textFont; 202 | _hourLabel.layer.cornerRadius = 4; 203 | _hourLabel.layer.shouldRasterize = YES; 204 | _hourLabel.layer.rasterizationScale = [UIScreen mainScreen].scale; 205 | _hourLabel.clipsToBounds = YES; 206 | _hourLabel.text = @"00"; 207 | } 208 | return _hourLabel; 209 | } 210 | 211 | - (UILabel *)minuteLabel 212 | { 213 | if (!_minuteLabel) 214 | { 215 | _minuteLabel = [UILabel new]; 216 | _minuteLabel.textAlignment = NSTextAlignmentCenter; 217 | _minuteLabel.backgroundColor = _themeColor; 218 | _minuteLabel.textColor = _textColor; 219 | _minuteLabel.font = _textFont; 220 | _minuteLabel.layer.cornerRadius = 4; 221 | _minuteLabel.layer.shouldRasterize = YES; 222 | _minuteLabel.layer.rasterizationScale = [UIScreen mainScreen].scale; 223 | _minuteLabel.clipsToBounds = YES; 224 | _minuteLabel.text = @"00"; 225 | } 226 | return _minuteLabel; 227 | } 228 | 229 | - (UILabel *)secondLabel 230 | { 231 | if (!_secondLabel) 232 | { 233 | _secondLabel = [UILabel new]; 234 | _secondLabel.textAlignment = NSTextAlignmentCenter; 235 | _secondLabel.backgroundColor = _themeColor; 236 | _secondLabel.textColor = _textColor; 237 | _secondLabel.font = _textFont; 238 | _secondLabel.layer.cornerRadius = 4; 239 | _secondLabel.layer.shouldRasterize = YES; 240 | _secondLabel.layer.rasterizationScale = [UIScreen mainScreen].scale; 241 | _secondLabel.clipsToBounds = YES; 242 | _secondLabel.text = @"00"; 243 | } 244 | return _secondLabel; 245 | } 246 | 247 | #pragma mark set property value 248 | - (void)setThemeColor:(UIColor *)themeColor 249 | { 250 | if (_themeColor != themeColor) 251 | { 252 | _themeColor = themeColor; 253 | _minuteLabel.backgroundColor = themeColor; 254 | _secondLabel.backgroundColor = themeColor; 255 | _hourLabel.backgroundColor = themeColor; 256 | } 257 | } 258 | 259 | - (void)setTextColor:(UIColor *)textColor 260 | { 261 | if (_textColor != textColor) 262 | { 263 | _textColor = textColor; 264 | _minuteLabel.textColor = textColor; 265 | _secondLabel.textColor = textColor; 266 | _hourLabel.textColor = textColor; 267 | } 268 | } 269 | 270 | - (void)setTextFont:(UIFont *)textFont 271 | { 272 | if (_textFont != textFont) 273 | { 274 | _textFont = textFont; 275 | _secondLabel.font = textFont; 276 | _minuteLabel.font = textFont; 277 | _hourLabel.font = textFont; 278 | if (_colonsArray.count > 0) 279 | { 280 | for (UILabel *label in _colonsArray) 281 | { 282 | label.font = textFont; 283 | } 284 | } 285 | } 286 | } 287 | 288 | - (void)setColonColor:(UIColor *)colonColor 289 | { 290 | if (_colonColor != colonColor) 291 | { 292 | _colonColor = colonColor; 293 | if (_colonsArray.count > 0) 294 | { 295 | for (UILabel *label in _colonsArray) 296 | { 297 | label.textColor = colonColor; 298 | } 299 | } 300 | } 301 | } 302 | 303 | - (void)setCountDownTimeInterval:(NSTimeInterval)countDownTimeInterval 304 | { 305 | _countDownTimeInterval = countDownTimeInterval; 306 | if (_countDownTimeInterval < 0) 307 | { 308 | _countDownTimeInterval = 0; 309 | } 310 | _second = (int)_countDownTimeInterval % 60; 311 | _minute = ((int)_countDownTimeInterval / 60) % 60; 312 | _hour = _countDownTimeInterval / 3600; 313 | [self setHourText:[NSString stringWithFormat:@"%02d", _hour]]; 314 | _minuteLabel.text = [NSString stringWithFormat:@"%02d", _minute]; 315 | _secondLabel.text = [NSString stringWithFormat:@"%02d", _second]; 316 | if (_countDownTimeInterval > 0 && !_timer) 317 | { 318 | [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; 319 | // [self.timer fire]; 320 | } 321 | } 322 | 323 | - (void)setLabelBorderColor:(UIColor *)labelBorderColor { 324 | _hourLabel.layer.borderColor = _minuteLabel.layer.borderColor = _secondLabel.layer.borderColor = labelBorderColor.CGColor; 325 | _hourLabel.layer.borderWidth = _minuteLabel.layer.borderWidth = _secondLabel.layer.borderWidth = 0.5; 326 | } 327 | 328 | - (NSTimer *)timer 329 | { 330 | if (!_timer) 331 | { 332 | _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(adjustCoundDownTimer:) userInfo:nil repeats:YES]; 333 | } 334 | return _timer; 335 | } 336 | 337 | - (void)adjustCoundDownTimer:(NSTimer *)timer 338 | { 339 | _countDownTimeInterval --; 340 | if (_minute == 0 && _hour > 0) 341 | { 342 | _hour -= 1; 343 | _minute = 60; 344 | [self setHourText:[NSString stringWithFormat:@"%02d", _hour]]; 345 | } 346 | 347 | if (_second == 0 && _minute > 0) 348 | { 349 | _second = 60; 350 | if (_minute > 0) 351 | { 352 | _minute -= 1; 353 | _minuteLabel.text = [NSString stringWithFormat:@"%02d", _minute]; 354 | } 355 | } 356 | 357 | if (_second > 0) 358 | { 359 | _second -= 1; 360 | _secondLabel.text = [NSString stringWithFormat:@"%02d", _second]; 361 | } 362 | 363 | if (_second <= 0 && _minute <= 0 && _hour <= 0) 364 | { 365 | [_timer invalidate]; 366 | _timer = nil; 367 | if (_delegate && [_delegate respondsToSelector:@selector(countDownDidFinished)]) { 368 | [_delegate countDownDidFinished]; 369 | } 370 | } 371 | } 372 | 373 | - (void)stopCountDown 374 | { 375 | [self removeObservers]; 376 | [_timer invalidate]; 377 | _timer = nil; 378 | } 379 | 380 | #pragma mark Observers and methods 381 | 382 | - (void)observeNotification 383 | { 384 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; 385 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForground:) name:UIApplicationWillEnterForegroundNotification object:nil]; 386 | _didRegisterNotificaton = YES; 387 | } 388 | 389 | - (void)removeObservers 390 | { 391 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 392 | _didRegisterNotificaton = NO; 393 | } 394 | 395 | - (void)didInBackground:(NSNotification *)notification 396 | { 397 | _endBackgroundTimeInterval = [[NSDate date] timeIntervalSince1970]; 398 | _countDownLeftTimeInterval = _countDownTimeInterval; 399 | } 400 | 401 | - (void)willEnterForground:(NSNotification *)notification 402 | { 403 | NSTimeInterval currentTimeInterval = [[NSDate date] timeIntervalSince1970]; 404 | NSTimeInterval diff = currentTimeInterval - _endBackgroundTimeInterval; 405 | [self setCountDownTimeInterval:_countDownLeftTimeInterval - diff]; 406 | } 407 | 408 | - (void)dealloc 409 | { 410 | [self removeObservers]; 411 | _textColor = nil; 412 | _textFont = nil; 413 | _themeColor = nil; 414 | _textFont = nil; 415 | _colonsArray = nil; 416 | _hourLabel = nil; 417 | _minuteLabel = nil; 418 | _secondLabel = nil; 419 | } 420 | 421 | @end 422 | -------------------------------------------------------------------------------- /Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DF6074F41B70934B00E27133 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6074F31B70934B00E27133 /* main.m */; }; 11 | DF6074F71B70934B00E27133 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6074F61B70934B00E27133 /* AppDelegate.m */; }; 12 | DF6074FA1B70934B00E27133 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6074F91B70934B00E27133 /* ViewController.m */; }; 13 | DF6074FD1B70934B00E27133 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DF6074FB1B70934B00E27133 /* Main.storyboard */; }; 14 | DF6074FF1B70934B00E27133 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DF6074FE1B70934B00E27133 /* Images.xcassets */; }; 15 | DF6075021B70934B00E27133 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DF6075001B70934B00E27133 /* LaunchScreen.xib */; }; 16 | DF60750E1B70934B00E27133 /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DF60750D1B70934B00E27133 /* DemoTests.m */; }; 17 | DF60751A1B70939B00E27133 /* ZQCountDownView.m in Sources */ = {isa = PBXBuildFile; fileRef = DF6075191B70939B00E27133 /* ZQCountDownView.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | DF6075081B70934B00E27133 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = DF6074E61B70934B00E27133 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = DF6074ED1B70934B00E27133; 26 | remoteInfo = Demo; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | DF6074EE1B70934B00E27133 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | DF6074F21B70934B00E27133 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | DF6074F31B70934B00E27133 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | DF6074F51B70934B00E27133 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | DF6074F61B70934B00E27133 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | DF6074F81B70934B00E27133 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 37 | DF6074F91B70934B00E27133 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 38 | DF6074FC1B70934B00E27133 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | DF6074FE1B70934B00E27133 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 40 | DF6075011B70934B00E27133 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | DF6075071B70934B00E27133 /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | DF60750C1B70934B00E27133 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | DF60750D1B70934B00E27133 /* DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTests.m; sourceTree = ""; }; 44 | DF6075181B70939B00E27133 /* ZQCountDownView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZQCountDownView.h; sourceTree = ""; }; 45 | DF6075191B70939B00E27133 /* ZQCountDownView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZQCountDownView.m; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | DF6074EB1B70934B00E27133 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | DF6075041B70934B00E27133 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | DF6074E51B70934B00E27133 = { 67 | isa = PBXGroup; 68 | children = ( 69 | DF6075171B70939B00E27133 /* CountDownView */, 70 | DF6074F01B70934B00E27133 /* Demo */, 71 | DF60750A1B70934B00E27133 /* DemoTests */, 72 | DF6074EF1B70934B00E27133 /* Products */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | DF6074EF1B70934B00E27133 /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | DF6074EE1B70934B00E27133 /* Demo.app */, 80 | DF6075071B70934B00E27133 /* DemoTests.xctest */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | DF6074F01B70934B00E27133 /* Demo */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | DF6074F51B70934B00E27133 /* AppDelegate.h */, 89 | DF6074F61B70934B00E27133 /* AppDelegate.m */, 90 | DF6074F81B70934B00E27133 /* ViewController.h */, 91 | DF6074F91B70934B00E27133 /* ViewController.m */, 92 | DF6074FB1B70934B00E27133 /* Main.storyboard */, 93 | DF6074FE1B70934B00E27133 /* Images.xcassets */, 94 | DF6075001B70934B00E27133 /* LaunchScreen.xib */, 95 | DF6074F11B70934B00E27133 /* Supporting Files */, 96 | ); 97 | path = Demo; 98 | sourceTree = ""; 99 | }; 100 | DF6074F11B70934B00E27133 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | DF6074F21B70934B00E27133 /* Info.plist */, 104 | DF6074F31B70934B00E27133 /* main.m */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | DF60750A1B70934B00E27133 /* DemoTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | DF60750D1B70934B00E27133 /* DemoTests.m */, 113 | DF60750B1B70934B00E27133 /* Supporting Files */, 114 | ); 115 | path = DemoTests; 116 | sourceTree = ""; 117 | }; 118 | DF60750B1B70934B00E27133 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | DF60750C1B70934B00E27133 /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | DF6075171B70939B00E27133 /* CountDownView */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | DF6075181B70939B00E27133 /* ZQCountDownView.h */, 130 | DF6075191B70939B00E27133 /* ZQCountDownView.m */, 131 | ); 132 | path = CountDownView; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | DF6074ED1B70934B00E27133 /* Demo */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = DF6075111B70934B00E27133 /* Build configuration list for PBXNativeTarget "Demo" */; 141 | buildPhases = ( 142 | DF6074EA1B70934B00E27133 /* Sources */, 143 | DF6074EB1B70934B00E27133 /* Frameworks */, 144 | DF6074EC1B70934B00E27133 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = Demo; 151 | productName = Demo; 152 | productReference = DF6074EE1B70934B00E27133 /* Demo.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | DF6075061B70934B00E27133 /* DemoTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = DF6075141B70934B00E27133 /* Build configuration list for PBXNativeTarget "DemoTests" */; 158 | buildPhases = ( 159 | DF6075031B70934B00E27133 /* Sources */, 160 | DF6075041B70934B00E27133 /* Frameworks */, 161 | DF6075051B70934B00E27133 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | DF6075091B70934B00E27133 /* PBXTargetDependency */, 167 | ); 168 | name = DemoTests; 169 | productName = DemoTests; 170 | productReference = DF6075071B70934B00E27133 /* DemoTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | DF6074E61B70934B00E27133 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0640; 180 | ORGANIZATIONNAME = aoliday; 181 | TargetAttributes = { 182 | DF6074ED1B70934B00E27133 = { 183 | CreatedOnToolsVersion = 6.4; 184 | }; 185 | DF6075061B70934B00E27133 = { 186 | CreatedOnToolsVersion = 6.4; 187 | TestTargetID = DF6074ED1B70934B00E27133; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = DF6074E91B70934B00E27133 /* Build configuration list for PBXProject "Demo" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = DF6074E51B70934B00E27133; 200 | productRefGroup = DF6074EF1B70934B00E27133 /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | DF6074ED1B70934B00E27133 /* Demo */, 205 | DF6075061B70934B00E27133 /* DemoTests */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | DF6074EC1B70934B00E27133 /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | DF6074FD1B70934B00E27133 /* Main.storyboard in Resources */, 216 | DF6075021B70934B00E27133 /* LaunchScreen.xib in Resources */, 217 | DF6074FF1B70934B00E27133 /* Images.xcassets in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | DF6075051B70934B00E27133 /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | DF6074EA1B70934B00E27133 /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | DF6074FA1B70934B00E27133 /* ViewController.m in Sources */, 236 | DF6074F71B70934B00E27133 /* AppDelegate.m in Sources */, 237 | DF6074F41B70934B00E27133 /* main.m in Sources */, 238 | DF60751A1B70939B00E27133 /* ZQCountDownView.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | DF6075031B70934B00E27133 /* Sources */ = { 243 | isa = PBXSourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | DF60750E1B70934B00E27133 /* DemoTests.m in Sources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXSourcesBuildPhase section */ 251 | 252 | /* Begin PBXTargetDependency section */ 253 | DF6075091B70934B00E27133 /* PBXTargetDependency */ = { 254 | isa = PBXTargetDependency; 255 | target = DF6074ED1B70934B00E27133 /* Demo */; 256 | targetProxy = DF6075081B70934B00E27133 /* PBXContainerItemProxy */; 257 | }; 258 | /* End PBXTargetDependency section */ 259 | 260 | /* Begin PBXVariantGroup section */ 261 | DF6074FB1B70934B00E27133 /* Main.storyboard */ = { 262 | isa = PBXVariantGroup; 263 | children = ( 264 | DF6074FC1B70934B00E27133 /* Base */, 265 | ); 266 | name = Main.storyboard; 267 | sourceTree = ""; 268 | }; 269 | DF6075001B70934B00E27133 /* LaunchScreen.xib */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | DF6075011B70934B00E27133 /* Base */, 273 | ); 274 | name = LaunchScreen.xib; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXVariantGroup section */ 278 | 279 | /* Begin XCBuildConfiguration section */ 280 | DF60750F1B70934B00E27133 /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 285 | CLANG_CXX_LIBRARY = "libc++"; 286 | CLANG_ENABLE_MODULES = YES; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_WARN_BOOL_CONVERSION = YES; 289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_EMPTY_BODY = YES; 292 | CLANG_WARN_ENUM_CONVERSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | COPY_PHASE_STRIP = NO; 299 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | GCC_C_LANGUAGE_STANDARD = gnu99; 302 | GCC_DYNAMIC_NO_PIC = NO; 303 | GCC_NO_COMMON_BLOCKS = YES; 304 | GCC_OPTIMIZATION_LEVEL = 0; 305 | GCC_PREPROCESSOR_DEFINITIONS = ( 306 | "DEBUG=1", 307 | "$(inherited)", 308 | ); 309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 317 | MTL_ENABLE_DEBUG_INFO = YES; 318 | ONLY_ACTIVE_ARCH = YES; 319 | SDKROOT = iphoneos; 320 | }; 321 | name = Debug; 322 | }; 323 | DF6075101B70934B00E27133 /* Release */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INT_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN_UNREACHABLE_CODE = YES; 339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 340 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 341 | COPY_PHASE_STRIP = NO; 342 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 343 | ENABLE_NS_ASSERTIONS = NO; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_NO_COMMON_BLOCKS = YES; 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 354 | MTL_ENABLE_DEBUG_INFO = NO; 355 | SDKROOT = iphoneos; 356 | VALIDATE_PRODUCT = YES; 357 | }; 358 | name = Release; 359 | }; 360 | DF6075121B70934B00E27133 /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 364 | INFOPLIST_FILE = Demo/Info.plist; 365 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | TARGETED_DEVICE_FAMILY = 1; 369 | }; 370 | name = Debug; 371 | }; 372 | DF6075131B70934B00E27133 /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 376 | INFOPLIST_FILE = Demo/Info.plist; 377 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 378 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 379 | PRODUCT_NAME = "$(TARGET_NAME)"; 380 | TARGETED_DEVICE_FAMILY = 1; 381 | }; 382 | name = Release; 383 | }; 384 | DF6075151B70934B00E27133 /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | BUNDLE_LOADER = "$(TEST_HOST)"; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(SDKROOT)/Developer/Library/Frameworks", 390 | "$(inherited)", 391 | ); 392 | GCC_PREPROCESSOR_DEFINITIONS = ( 393 | "DEBUG=1", 394 | "$(inherited)", 395 | ); 396 | INFOPLIST_FILE = DemoTests/Info.plist; 397 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 400 | }; 401 | name = Debug; 402 | }; 403 | DF6075161B70934B00E27133 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | BUNDLE_LOADER = "$(TEST_HOST)"; 407 | FRAMEWORK_SEARCH_PATHS = ( 408 | "$(SDKROOT)/Developer/Library/Frameworks", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = DemoTests/Info.plist; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | DF6074E91B70934B00E27133 /* Build configuration list for PBXProject "Demo" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | DF60750F1B70934B00E27133 /* Debug */, 425 | DF6075101B70934B00E27133 /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | DF6075111B70934B00E27133 /* Build configuration list for PBXNativeTarget "Demo" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | DF6075121B70934B00E27133 /* Debug */, 434 | DF6075131B70934B00E27133 /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | defaultConfigurationName = Release; 438 | }; 439 | DF6075141B70934B00E27133 /* Build configuration list for PBXNativeTarget "DemoTests" */ = { 440 | isa = XCConfigurationList; 441 | buildConfigurations = ( 442 | DF6075151B70934B00E27133 /* Debug */, 443 | DF6075161B70934B00E27133 /* Release */, 444 | ); 445 | defaultConfigurationIsVisible = 0; 446 | defaultConfigurationName = Release; 447 | }; 448 | /* End XCConfigurationList section */ 449 | }; 450 | rootObject = DF6074E61B70934B00E27133 /* Project object */; 451 | } 452 | --------------------------------------------------------------------------------