├── screenshot.png ├── CTCheckboxSample ├── en.lproj │ ├── InfoPlist.strings │ └── MainStoryboard.storyboard ├── Default.png ├── Default@2x.png ├── Default-568h@2x.png ├── CTAppDelegate.h ├── CTCheckboxSample-Prefix.pch ├── main.m ├── CTViewController.h ├── CTCheckboxSample-Info.plist ├── CTAppDelegate.m └── CTViewController.m ├── CTCheckbox ├── CTCheckbox-Prefix.pch ├── CTCheckbox.h └── CTCheckbox.m ├── CTCheckbox.podspec ├── .gitignore ├── README.md ├── LICENSE └── CTCheckbox.xcodeproj └── project.pbxproj /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizumita/CTCheckbox/HEAD/screenshot.png -------------------------------------------------------------------------------- /CTCheckboxSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CTCheckboxSample/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizumita/CTCheckbox/HEAD/CTCheckboxSample/Default.png -------------------------------------------------------------------------------- /CTCheckboxSample/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizumita/CTCheckbox/HEAD/CTCheckboxSample/Default@2x.png -------------------------------------------------------------------------------- /CTCheckboxSample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rizumita/CTCheckbox/HEAD/CTCheckboxSample/Default-568h@2x.png -------------------------------------------------------------------------------- /CTCheckbox/CTCheckbox-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CTCheckbox' target in the 'CTCheckbox' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTAppDelegate.h 3 | // CTCheckboxSample 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CTAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTCheckboxSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CTCheckboxSample' target in the 'CTCheckboxSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /CTCheckboxSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CTCheckboxSample 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CTAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CTAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CTCheckbox.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CTCheckbox" 3 | s.version = "0.0.5" 4 | s.summary = "CTCheckbox is a checkbox UI component library for iOS." 5 | s.homepage = "https://github.com/rizumita/CTCheckbox" 6 | s.license = { :type => 'MIT', :file => 'LICENSE' } 7 | s.author = { "Ryoichi Izumita" => "r.izumita@caph.jp" } 8 | s.source = { :git => "https://github.com/rizumita/CTCheckbox.git", :tag => "0.0.5" } 9 | s.platform = :ios, '5.0' 10 | s.source_files = 'CTCheckbox/CTCheckbox.{h,m}' 11 | s.requires_arc = true 12 | end 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### /Users/rizumita/.gitignore-boilerplates/Global/OSX.gitignore 2 | 3 | .DS_Store 4 | .AppleDouble 5 | .LSOverride 6 | Icon 7 | 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | # Files that might appear on external disk 13 | .Spotlight-V100 14 | .Trashes 15 | 16 | 17 | ### /Users/rizumita/.gitignore-boilerplates/Objective-C.gitignore 18 | 19 | # Xcode 20 | .DS_Store 21 | */build/* 22 | *.pbxuser 23 | !default.pbxuser 24 | *.mode1v3 25 | !default.mode1v3 26 | *.mode2v3 27 | !default.mode2v3 28 | *.perspectivev3 29 | !default.perspectivev3 30 | *.xcworkspace 31 | !default.xcworkspace 32 | xcuserdata 33 | profile 34 | *.moved-aside 35 | DerivedData 36 | .idea/ 37 | *.hmap 38 | 39 | 40 | -------------------------------------------------------------------------------- /CTCheckbox/CTCheckbox.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTCheckbox.h 3 | // CTCheckbox 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CTCheckbox : UIControl 13 | 14 | @property (nonatomic) BOOL checked; 15 | @property (nonatomic, strong) UIColor *checkboxColor; 16 | @property (nonatomic) float checkboxSideLength; 17 | @property (nonatomic, strong) UILabel *textLabel; 18 | 19 | - (void)setColor:(UIColor *)color forControlState:(UIControlState)state; 20 | 21 | - (void)setBackgroundColor:(UIColor *)backgroundColor forControlState:(UIControlState)state; 22 | 23 | -(void)setChecked:(BOOL)checked withEvent:(BOOL)withEvent; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTViewController.h 3 | // CTCheckboxSample 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CTCheckbox; 12 | 13 | @interface CTViewController : UIViewController 14 | 15 | @property (weak, nonatomic) IBOutlet CTCheckbox *checkbox; 16 | @property (weak, nonatomic) IBOutlet UITextField *textField; 17 | @property (weak, nonatomic) IBOutlet UILabel *label; 18 | 19 | - (IBAction)blackButtonTapped:(id)sender; 20 | - (IBAction)blueButtonTapped:(id)sender; 21 | - (IBAction)redButtonTapped:(id)sender; 22 | - (IBAction)textChanged:(id)sender; 23 | - (IBAction)normalButtonTapped:(id)sender; 24 | - (IBAction)disableButtonTapped:(id)sender; 25 | @end 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CTCheckbox 2 | ========== 3 | 4 | CTCheckbox is a checkbox UI component library for iOS 5+, 5 | 6 | ![Screenshot](https://raw.github.com/rizumita/CTCheckbox/master/screenshot.png) 7 | 8 | Usage 9 | =============== 10 | 11 | You put UIView on a storyboard and change it's class to CTCheckbox. 12 | UIViewController 13 | ```Objective-C 14 | @property (weak, nonatomic) IBOutlet CTCheckbox *checkbox; 15 | ``` 16 | ```Objective-C 17 | [self.checkbox addTarget:self action:@selector(checkboxDidChange:) forControlEvents:UIControlEventValueChanged]; 18 | self.checkbox.textLabel.text = @"Label text"; 19 | ``` 20 | ```Objective-C 21 | - (void)checkboxDidChange:(CTCheckbox *)checkbox 22 | { 23 | NSLog(@"%d", checkbox.checked); 24 | } 25 | ``` 26 | Or create using initWithFrame:. 27 | 28 | License 29 | =============== 30 | CTCheckbox is available under the MIT license. See the LICENSE file for more info. 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Ryoichi Izumita 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTCheckboxSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | jp.caph.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTAppDelegate.m 3 | // CTCheckboxSample 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import "CTAppDelegate.h" 10 | 11 | @implementation CTAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 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 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /CTCheckboxSample/CTViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTViewController.m 3 | // CTCheckboxSample 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import "CTViewController.h" 10 | #import "CTCheckbox.h" 11 | 12 | @interface CTViewController () 13 | 14 | @property (nonatomic, strong) CTCheckbox *checkbox2; 15 | @property (nonatomic, strong) CTCheckbox *checkbox3; 16 | @end 17 | 18 | @implementation CTViewController 19 | 20 | - (void)viewDidLoad 21 | { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | [self.checkbox addTarget:self action:@selector(checkboxDidChange:) forControlEvents:UIControlEventValueChanged]; 25 | self.checkbox.textLabel.text = @"sample text sample text"; 26 | [self.checkbox setColor:[UIColor blackColor] forControlState:UIControlStateNormal]; 27 | [self.checkbox setColor:[UIColor grayColor] forControlState:UIControlStateDisabled]; 28 | [self checkboxDidChange:self.checkbox]; 29 | 30 | self.checkbox2 = [[CTCheckbox alloc] initWithFrame:CGRectMake(20.0, 220.0, 280.0, 20.0)]; 31 | self.checkbox2.textLabel.text = @"by initWithFrame:"; 32 | [self.view addSubview:self.checkbox2]; 33 | 34 | self.checkbox3 = [[CTCheckbox alloc] initWithFrame:CGRectMake(20.0, 260.0, 280.0, 40.0)]; 35 | self.checkbox3.checkboxSideLength = 40.0; 36 | self.checkbox3.textLabel.text = @"checkboxSideLength is 40.0"; 37 | [self.view addSubview:self.checkbox3]; 38 | } 39 | 40 | - (void)checkboxDidChange:(CTCheckbox *)checkbox 41 | { 42 | if (checkbox.checked) { 43 | self.label.text = @"Checked"; 44 | } else { 45 | self.label.text = @"Not checked"; 46 | } 47 | } 48 | 49 | - (void)didReceiveMemoryWarning 50 | { 51 | [super didReceiveMemoryWarning]; 52 | // Dispose of any resources that can be recreated. 53 | } 54 | 55 | - (IBAction)blackButtonTapped:(id)sender 56 | { 57 | self.checkbox.checkboxColor = [UIColor blackColor]; 58 | } 59 | 60 | - (IBAction)blueButtonTapped:(id)sender 61 | { 62 | self.checkbox.checkboxColor = [UIColor blueColor]; 63 | } 64 | 65 | - (IBAction)redButtonTapped:(id)sender 66 | { 67 | self.checkbox.checkboxColor = [UIColor redColor]; 68 | } 69 | 70 | - (IBAction)textChanged:(id)sender 71 | { 72 | self.checkbox.textLabel.text = [(UITextField *)sender text]; 73 | } 74 | 75 | - (IBAction)normalButtonTapped:(id)sender { 76 | self.checkbox.enabled = YES; 77 | } 78 | 79 | - (IBAction)disableButtonTapped:(id)sender { 80 | self.checkbox.enabled = NO; 81 | } 82 | 83 | #pragma mark - UITextField delegate 84 | 85 | - (BOOL)textFieldShouldReturn:(UITextField *)textField 86 | { 87 | [textField resignFirstResponder]; 88 | return YES; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /CTCheckbox/CTCheckbox.m: -------------------------------------------------------------------------------- 1 | // 2 | // CTCheckbox.m 3 | // CTCheckbox 4 | // 5 | // Created by 和泉田 領一 on 2013/03/06. 6 | // Copyright (c) 2013年 CAPH. All rights reserved. 7 | // 8 | 9 | #import "CTCheckbox.h" 10 | 11 | static const float CTCheckboxDefaultSideLength = 20.0; 12 | 13 | @interface CTCheckbox () 14 | @property (nonatomic, strong) NSMutableDictionary *colorDictionary; 15 | @property (nonatomic, strong) NSMutableDictionary *backgroundColorDictionary; 16 | @end 17 | 18 | @implementation CTCheckbox 19 | 20 | - (id)initWithFrame:(CGRect)frame 21 | { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | [self setUp]; 25 | } 26 | return self; 27 | } 28 | 29 | - (id)initWithCoder:(NSCoder *)aDecoder 30 | { 31 | self = [super initWithCoder:aDecoder]; 32 | if (self) { 33 | [self setUp]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)setUp 39 | { 40 | self.colorDictionary = [NSMutableDictionary dictionary]; 41 | self.backgroundColorDictionary = [NSMutableDictionary dictionary]; 42 | 43 | self.checkboxSideLength = CTCheckboxDefaultSideLength; 44 | self.checkboxColor = [UIColor blackColor]; 45 | self.backgroundColor = [UIColor clearColor]; 46 | self.textLabel = [[UILabel alloc] initWithFrame:CGRectZero]; 47 | self.textLabel.backgroundColor = [UIColor clearColor]; 48 | [self addSubview:self.textLabel]; 49 | 50 | [self addObserver:self forKeyPath:@"enabled" options:NSKeyValueObservingOptionNew context:nil]; 51 | [self addObserver:self forKeyPath:@"selected" options:NSKeyValueObservingOptionNew context:nil]; 52 | [self addObserver:self forKeyPath:@"highlighted" options:NSKeyValueObservingOptionNew context:nil]; 53 | } 54 | 55 | - (void)dealloc 56 | { 57 | [self removeObserver:self forKeyPath:@"enabled"]; 58 | [self removeObserver:self forKeyPath:@"selected"]; 59 | [self removeObserver:self forKeyPath:@"highlighted"]; 60 | } 61 | 62 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change 63 | context:(void *)context 64 | { 65 | if ([keyPath isEqualToString:@"enabled"] || [keyPath isEqualToString:@"selected"] || [keyPath isEqualToString:@"highlighted"]) { 66 | [self changeColorForState:self.state]; 67 | [self changeBackgroundColorForState:self.state]; 68 | } else { 69 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 70 | } 71 | } 72 | 73 | - (void)changeColorForState:(UIControlState)state 74 | { 75 | UIColor *color; 76 | 77 | switch (state) { 78 | case UIControlStateNormal: 79 | color = self.colorDictionary[@(UIControlStateNormal)]; 80 | break; 81 | case UIControlStateSelected: 82 | color = self.colorDictionary[@(UIControlStateSelected)]; 83 | break; 84 | case UIControlStateDisabled: 85 | color = self.colorDictionary[@(UIControlStateDisabled)]; 86 | break; 87 | default: 88 | break; 89 | } 90 | 91 | if (!color) { 92 | color = [UIColor blackColor]; 93 | } 94 | 95 | self.checkboxColor = color; 96 | self.textLabel.textColor = color; 97 | } 98 | 99 | - (void)changeBackgroundColorForState:(UIControlState)state 100 | { 101 | UIColor *color; 102 | 103 | switch (state) { 104 | case UIControlStateNormal: 105 | color = self.backgroundColorDictionary[@(UIControlStateNormal)]; 106 | break; 107 | case UIControlStateSelected: 108 | color = self.backgroundColorDictionary[@(UIControlStateSelected)]; 109 | break; 110 | case UIControlStateDisabled: 111 | color = self.backgroundColorDictionary[@(UIControlStateDisabled)]; 112 | break; 113 | default: 114 | break; 115 | } 116 | 117 | if (!color) { 118 | color = [UIColor clearColor]; 119 | } 120 | 121 | self.backgroundColor = color; 122 | } 123 | 124 | - (void)setChecked:(BOOL)checked 125 | { 126 | [self setChecked:checked withEvent:YES]; 127 | } 128 | -(void)setChecked:(BOOL)checked withEvent:(BOOL)withEvent 129 | { 130 | _checked = checked; 131 | 132 | [self setNeedsDisplay]; 133 | 134 | if(withEvent) 135 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 136 | } 137 | 138 | - (void)setCheckboxColor:(UIColor *)checkboxColor 139 | { 140 | _checkboxColor = checkboxColor; 141 | [self setNeedsDisplay]; 142 | } 143 | 144 | 145 | - (void)setColor:(UIColor *)color forControlState:(UIControlState)state 146 | { 147 | switch (state) { 148 | case UIControlStateNormal: 149 | self.colorDictionary[@(UIControlStateNormal)] = color; 150 | break; 151 | case UIControlStateSelected: 152 | self.colorDictionary[@(UIControlStateSelected)] = color; 153 | break; 154 | case UIControlStateDisabled: 155 | self.colorDictionary[@(UIControlStateDisabled)] = color; 156 | break; 157 | default: 158 | break; 159 | } 160 | 161 | [self changeColorForState:self.state]; 162 | } 163 | 164 | - (void)setBackgroundColor:(UIColor *)backgroundColor forControlState:(UIControlState)state 165 | { 166 | switch (state) { 167 | case UIControlStateNormal: 168 | self.backgroundColorDictionary[@(UIControlStateNormal)] = backgroundColor; 169 | break; 170 | case UIControlStateSelected: 171 | self.backgroundColorDictionary[@(UIControlStateSelected)] = backgroundColor; 172 | break; 173 | case UIControlStateDisabled: 174 | self.backgroundColorDictionary[@(UIControlStateDisabled)] = backgroundColor; 175 | break; 176 | default: 177 | break; 178 | } 179 | 180 | 181 | [self changeBackgroundColorForState:self.state]; 182 | } 183 | 184 | - (void)drawRect:(CGRect)rect 185 | { 186 | CGRect frame = CGRectIntegral(CGRectMake(0, (rect.size.height - self.checkboxSideLength) / 2.0, self.checkboxSideLength, self.checkboxSideLength)); 187 | 188 | if (self.checked) { 189 | UIBezierPath *bezierPath = [UIBezierPath bezierPath]; 190 | 191 | [bezierPath moveToPoint:CGPointMake(CGRectGetMinX(frame) + 0.75000 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.21875 * CGRectGetHeight(frame))]; 192 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.40000 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.52500 * CGRectGetHeight(frame))]; 193 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.28125 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.37500 * CGRectGetHeight(frame))]; 194 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.17500 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.47500 * CGRectGetHeight(frame))]; 195 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.40000 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.75000 * CGRectGetHeight(frame))]; 196 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.81250 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.28125 * CGRectGetHeight(frame))]; 197 | [bezierPath addLineToPoint:CGPointMake(CGRectGetMinX(frame) + 0.75000 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.21875 * CGRectGetHeight(frame))]; 198 | [bezierPath closePath]; 199 | 200 | [self.checkboxColor setFill]; 201 | [bezierPath fill]; 202 | } 203 | 204 | UIBezierPath *roundedRectanglePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.05000 + 0.5), CGRectGetMinY(frame) + floor(CGRectGetHeight(frame) * 0.05000 + 0.5), floor(CGRectGetWidth(frame) * 0.95000 + 0.5) - floor(CGRectGetWidth(frame) * 0.05000 + 0.5), floor(CGRectGetHeight(frame) * 0.95000 + 0.5) - floor(CGRectGetHeight(frame) * 0.05000 + 0.5)) cornerRadius:4]; 205 | roundedRectanglePath.lineWidth = 2 * self.checkboxSideLength / CTCheckboxDefaultSideLength; 206 | [self.checkboxColor setStroke]; 207 | [roundedRectanglePath stroke]; 208 | } 209 | 210 | - (void)layoutSubviews 211 | { 212 | [super layoutSubviews]; 213 | 214 | CGFloat textLabelOriginX = self.checkboxSideLength + 5.0; 215 | CGSize textLabelMaxSize = CGSizeMake(CGRectGetWidth(self.bounds) - textLabelOriginX, CGRectGetHeight(self.bounds)); 216 | 217 | CGRect r = [self.textLabel.text boundingRectWithSize:textLabelMaxSize options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:self.textLabel.font} context:nil]; 218 | 219 | CGSize textLabelSize = CGSizeMake(r.size.width, r.size.height); 220 | 221 | self.textLabel.frame = CGRectIntegral(CGRectMake(textLabelOriginX, (CGRectGetHeight(self.bounds) - textLabelSize.height) / 2.0, textLabelSize.width, textLabelSize.height)); 222 | } 223 | 224 | - (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event 225 | { 226 | CGPoint location = [touch locationInView:self]; 227 | if (CGRectContainsPoint(self.bounds, location)) { 228 | self.checked = !self.checked; 229 | } 230 | } 231 | 232 | @end 233 | -------------------------------------------------------------------------------- /CTCheckboxSample/en.lproj/MainStoryboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 48 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /CTCheckbox.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6A99A78516E6DB8000F173B2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A99A78416E6DB8000F173B2 /* Foundation.framework */; }; 11 | 6A99A78A16E6DB8000F173B2 /* CTCheckbox.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6A99A78916E6DB8000F173B2 /* CTCheckbox.h */; }; 12 | 6A99A78C16E6DB8000F173B2 /* CTCheckbox.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A99A78B16E6DB8000F173B2 /* CTCheckbox.m */; }; 13 | 6A99A79816E6DBA000F173B2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A99A79716E6DBA000F173B2 /* UIKit.framework */; }; 14 | 6A99A79916E6DBA000F173B2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A99A78416E6DB8000F173B2 /* Foundation.framework */; }; 15 | 6A99A79B16E6DBA000F173B2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A99A79A16E6DBA000F173B2 /* CoreGraphics.framework */; }; 16 | 6A99A7A116E6DBA000F173B2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6A99A79F16E6DBA000F173B2 /* InfoPlist.strings */; }; 17 | 6A99A7A316E6DBA000F173B2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A99A7A216E6DBA000F173B2 /* main.m */; }; 18 | 6A99A7A716E6DBA000F173B2 /* CTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A99A7A616E6DBA000F173B2 /* CTAppDelegate.m */; }; 19 | 6A99A7A916E6DBA000F173B2 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A99A7A816E6DBA000F173B2 /* Default.png */; }; 20 | 6A99A7AB16E6DBA000F173B2 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A99A7AA16E6DBA000F173B2 /* Default@2x.png */; }; 21 | 6A99A7AD16E6DBA000F173B2 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A99A7AC16E6DBA000F173B2 /* Default-568h@2x.png */; }; 22 | 6A99A7B016E6DBA000F173B2 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A99A7AE16E6DBA000F173B2 /* MainStoryboard.storyboard */; }; 23 | 6A99A7B316E6DBA000F173B2 /* CTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A99A7B216E6DBA000F173B2 /* CTViewController.m */; }; 24 | 6A99A7B716E6DF6600F173B2 /* CTCheckbox.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A99A78B16E6DB8000F173B2 /* CTCheckbox.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXCopyFilesBuildPhase section */ 28 | 6A99A77F16E6DB8000F173B2 /* CopyFiles */ = { 29 | isa = PBXCopyFilesBuildPhase; 30 | buildActionMask = 2147483647; 31 | dstPath = "include/${PRODUCT_NAME}"; 32 | dstSubfolderSpec = 16; 33 | files = ( 34 | 6A99A78A16E6DB8000F173B2 /* CTCheckbox.h in CopyFiles */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 6A99A78116E6DB8000F173B2 /* libCTCheckbox.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCTCheckbox.a; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 6A99A78416E6DB8000F173B2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 43 | 6A99A78816E6DB8000F173B2 /* CTCheckbox-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CTCheckbox-Prefix.pch"; sourceTree = ""; }; 44 | 6A99A78916E6DB8000F173B2 /* CTCheckbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTCheckbox.h; sourceTree = ""; }; 45 | 6A99A78B16E6DB8000F173B2 /* CTCheckbox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTCheckbox.m; sourceTree = ""; }; 46 | 6A99A79616E6DBA000F173B2 /* CTCheckboxSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CTCheckboxSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 6A99A79716E6DBA000F173B2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 48 | 6A99A79A16E6DBA000F173B2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 6A99A79E16E6DBA000F173B2 /* CTCheckboxSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CTCheckboxSample-Info.plist"; sourceTree = ""; }; 50 | 6A99A7A016E6DBA000F173B2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 51 | 6A99A7A216E6DBA000F173B2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 6A99A7A416E6DBA000F173B2 /* CTCheckboxSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CTCheckboxSample-Prefix.pch"; sourceTree = ""; }; 53 | 6A99A7A516E6DBA000F173B2 /* CTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTAppDelegate.h; sourceTree = ""; }; 54 | 6A99A7A616E6DBA000F173B2 /* CTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTAppDelegate.m; sourceTree = ""; }; 55 | 6A99A7A816E6DBA000F173B2 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 56 | 6A99A7AA16E6DBA000F173B2 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 57 | 6A99A7AC16E6DBA000F173B2 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 58 | 6A99A7AF16E6DBA000F173B2 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 59 | 6A99A7B116E6DBA000F173B2 /* CTViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTViewController.h; sourceTree = ""; }; 60 | 6A99A7B216E6DBA000F173B2 /* CTViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTViewController.m; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 6A99A77E16E6DB8000F173B2 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 6A99A78516E6DB8000F173B2 /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 6A99A79316E6DBA000F173B2 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 6A99A79816E6DBA000F173B2 /* UIKit.framework in Frameworks */, 77 | 6A99A79916E6DBA000F173B2 /* Foundation.framework in Frameworks */, 78 | 6A99A79B16E6DBA000F173B2 /* CoreGraphics.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 6A99A77816E6DB8000F173B2 = { 86 | isa = PBXGroup; 87 | children = ( 88 | 6A99A78616E6DB8000F173B2 /* CTCheckbox */, 89 | 6A99A79C16E6DBA000F173B2 /* CTCheckboxSample */, 90 | 6A99A78316E6DB8000F173B2 /* Frameworks */, 91 | 6A99A78216E6DB8000F173B2 /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 6A99A78216E6DB8000F173B2 /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 6A99A78116E6DB8000F173B2 /* libCTCheckbox.a */, 99 | 6A99A79616E6DBA000F173B2 /* CTCheckboxSample.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 6A99A78316E6DB8000F173B2 /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 6A99A78416E6DB8000F173B2 /* Foundation.framework */, 108 | 6A99A79716E6DBA000F173B2 /* UIKit.framework */, 109 | 6A99A79A16E6DBA000F173B2 /* CoreGraphics.framework */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | 6A99A78616E6DB8000F173B2 /* CTCheckbox */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 6A99A78916E6DB8000F173B2 /* CTCheckbox.h */, 118 | 6A99A78B16E6DB8000F173B2 /* CTCheckbox.m */, 119 | 6A99A78716E6DB8000F173B2 /* Supporting Files */, 120 | ); 121 | path = CTCheckbox; 122 | sourceTree = ""; 123 | }; 124 | 6A99A78716E6DB8000F173B2 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 6A99A78816E6DB8000F173B2 /* CTCheckbox-Prefix.pch */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 6A99A79C16E6DBA000F173B2 /* CTCheckboxSample */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 6A99A7A516E6DBA000F173B2 /* CTAppDelegate.h */, 136 | 6A99A7A616E6DBA000F173B2 /* CTAppDelegate.m */, 137 | 6A99A7AE16E6DBA000F173B2 /* MainStoryboard.storyboard */, 138 | 6A99A7B116E6DBA000F173B2 /* CTViewController.h */, 139 | 6A99A7B216E6DBA000F173B2 /* CTViewController.m */, 140 | 6A99A79D16E6DBA000F173B2 /* Supporting Files */, 141 | ); 142 | path = CTCheckboxSample; 143 | sourceTree = ""; 144 | }; 145 | 6A99A79D16E6DBA000F173B2 /* Supporting Files */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 6A99A79E16E6DBA000F173B2 /* CTCheckboxSample-Info.plist */, 149 | 6A99A79F16E6DBA000F173B2 /* InfoPlist.strings */, 150 | 6A99A7A216E6DBA000F173B2 /* main.m */, 151 | 6A99A7A416E6DBA000F173B2 /* CTCheckboxSample-Prefix.pch */, 152 | 6A99A7A816E6DBA000F173B2 /* Default.png */, 153 | 6A99A7AA16E6DBA000F173B2 /* Default@2x.png */, 154 | 6A99A7AC16E6DBA000F173B2 /* Default-568h@2x.png */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | 6A99A78016E6DB8000F173B2 /* CTCheckbox */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = 6A99A78F16E6DB8000F173B2 /* Build configuration list for PBXNativeTarget "CTCheckbox" */; 165 | buildPhases = ( 166 | 6A99A77D16E6DB8000F173B2 /* Sources */, 167 | 6A99A77E16E6DB8000F173B2 /* Frameworks */, 168 | 6A99A77F16E6DB8000F173B2 /* CopyFiles */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | ); 174 | name = CTCheckbox; 175 | productName = CTCheckbox; 176 | productReference = 6A99A78116E6DB8000F173B2 /* libCTCheckbox.a */; 177 | productType = "com.apple.product-type.library.static"; 178 | }; 179 | 6A99A79516E6DBA000F173B2 /* CTCheckboxSample */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = 6A99A7B416E6DBA000F173B2 /* Build configuration list for PBXNativeTarget "CTCheckboxSample" */; 182 | buildPhases = ( 183 | 6A99A79216E6DBA000F173B2 /* Sources */, 184 | 6A99A79316E6DBA000F173B2 /* Frameworks */, 185 | 6A99A79416E6DBA000F173B2 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = CTCheckboxSample; 192 | productName = CTCheckboxSample; 193 | productReference = 6A99A79616E6DBA000F173B2 /* CTCheckboxSample.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | /* End PBXNativeTarget section */ 197 | 198 | /* Begin PBXProject section */ 199 | 6A99A77916E6DB8000F173B2 /* Project object */ = { 200 | isa = PBXProject; 201 | attributes = { 202 | LastUpgradeCheck = 0460; 203 | ORGANIZATIONNAME = CAPH; 204 | }; 205 | buildConfigurationList = 6A99A77C16E6DB8000F173B2 /* Build configuration list for PBXProject "CTCheckbox" */; 206 | compatibilityVersion = "Xcode 3.2"; 207 | developmentRegion = English; 208 | hasScannedForEncodings = 0; 209 | knownRegions = ( 210 | en, 211 | ); 212 | mainGroup = 6A99A77816E6DB8000F173B2; 213 | productRefGroup = 6A99A78216E6DB8000F173B2 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 6A99A78016E6DB8000F173B2 /* CTCheckbox */, 218 | 6A99A79516E6DBA000F173B2 /* CTCheckboxSample */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 6A99A79416E6DBA000F173B2 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 6A99A7A116E6DBA000F173B2 /* InfoPlist.strings in Resources */, 229 | 6A99A7A916E6DBA000F173B2 /* Default.png in Resources */, 230 | 6A99A7AB16E6DBA000F173B2 /* Default@2x.png in Resources */, 231 | 6A99A7AD16E6DBA000F173B2 /* Default-568h@2x.png in Resources */, 232 | 6A99A7B016E6DBA000F173B2 /* MainStoryboard.storyboard in Resources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXResourcesBuildPhase section */ 237 | 238 | /* Begin PBXSourcesBuildPhase section */ 239 | 6A99A77D16E6DB8000F173B2 /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | 6A99A78C16E6DB8000F173B2 /* CTCheckbox.m in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | 6A99A79216E6DBA000F173B2 /* Sources */ = { 248 | isa = PBXSourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | 6A99A7B716E6DF6600F173B2 /* CTCheckbox.m in Sources */, 252 | 6A99A7A316E6DBA000F173B2 /* main.m in Sources */, 253 | 6A99A7A716E6DBA000F173B2 /* CTAppDelegate.m in Sources */, 254 | 6A99A7B316E6DBA000F173B2 /* CTViewController.m in Sources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | /* End PBXSourcesBuildPhase section */ 259 | 260 | /* Begin PBXVariantGroup section */ 261 | 6A99A79F16E6DBA000F173B2 /* InfoPlist.strings */ = { 262 | isa = PBXVariantGroup; 263 | children = ( 264 | 6A99A7A016E6DBA000F173B2 /* en */, 265 | ); 266 | name = InfoPlist.strings; 267 | sourceTree = ""; 268 | }; 269 | 6A99A7AE16E6DBA000F173B2 /* MainStoryboard.storyboard */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | 6A99A7AF16E6DBA000F173B2 /* en */, 273 | ); 274 | name = MainStoryboard.storyboard; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXVariantGroup section */ 278 | 279 | /* Begin XCBuildConfiguration section */ 280 | 6A99A78D16E6DB8000F173B2 /* 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_OBJC_ARC = YES; 287 | CLANG_WARN_CONSTANT_CONVERSION = YES; 288 | CLANG_WARN_EMPTY_BODY = YES; 289 | CLANG_WARN_ENUM_CONVERSION = YES; 290 | CLANG_WARN_INT_CONVERSION = YES; 291 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 292 | COPY_PHASE_STRIP = NO; 293 | GCC_C_LANGUAGE_STANDARD = gnu99; 294 | GCC_DYNAMIC_NO_PIC = NO; 295 | GCC_OPTIMIZATION_LEVEL = 0; 296 | GCC_PREPROCESSOR_DEFINITIONS = ( 297 | "DEBUG=1", 298 | "$(inherited)", 299 | ); 300 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 301 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 302 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 305 | ONLY_ACTIVE_ARCH = YES; 306 | SDKROOT = iphoneos; 307 | }; 308 | name = Debug; 309 | }; 310 | 6A99A78E16E6DB8000F173B2 /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_OBJC_ARC = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_EMPTY_BODY = YES; 319 | CLANG_WARN_ENUM_CONVERSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 322 | COPY_PHASE_STRIP = YES; 323 | GCC_C_LANGUAGE_STANDARD = gnu99; 324 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 328 | SDKROOT = iphoneos; 329 | VALIDATE_PRODUCT = YES; 330 | }; 331 | name = Release; 332 | }; 333 | 6A99A79016E6DB8000F173B2 /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | DSTROOT = /tmp/CTCheckbox.dst; 337 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 338 | GCC_PREFIX_HEADER = "CTCheckbox/CTCheckbox-Prefix.pch"; 339 | OTHER_LDFLAGS = "-ObjC"; 340 | PRODUCT_NAME = "$(TARGET_NAME)"; 341 | SKIP_INSTALL = YES; 342 | }; 343 | name = Debug; 344 | }; 345 | 6A99A79116E6DB8000F173B2 /* Release */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | DSTROOT = /tmp/CTCheckbox.dst; 349 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 350 | GCC_PREFIX_HEADER = "CTCheckbox/CTCheckbox-Prefix.pch"; 351 | OTHER_LDFLAGS = "-ObjC"; 352 | PRODUCT_NAME = "$(TARGET_NAME)"; 353 | SKIP_INSTALL = YES; 354 | }; 355 | name = Release; 356 | }; 357 | 6A99A7B516E6DBA000F173B2 /* Debug */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 362 | GCC_PREFIX_HEADER = "CTCheckboxSample/CTCheckboxSample-Prefix.pch"; 363 | INFOPLIST_FILE = "CTCheckboxSample/CTCheckboxSample-Info.plist"; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | WRAPPER_EXTENSION = app; 366 | }; 367 | name = Debug; 368 | }; 369 | 6A99A7B616E6DBA000F173B2 /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 373 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 374 | GCC_PREFIX_HEADER = "CTCheckboxSample/CTCheckboxSample-Prefix.pch"; 375 | INFOPLIST_FILE = "CTCheckboxSample/CTCheckboxSample-Info.plist"; 376 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | WRAPPER_EXTENSION = app; 379 | }; 380 | name = Release; 381 | }; 382 | /* End XCBuildConfiguration section */ 383 | 384 | /* Begin XCConfigurationList section */ 385 | 6A99A77C16E6DB8000F173B2 /* Build configuration list for PBXProject "CTCheckbox" */ = { 386 | isa = XCConfigurationList; 387 | buildConfigurations = ( 388 | 6A99A78D16E6DB8000F173B2 /* Debug */, 389 | 6A99A78E16E6DB8000F173B2 /* Release */, 390 | ); 391 | defaultConfigurationIsVisible = 0; 392 | defaultConfigurationName = Release; 393 | }; 394 | 6A99A78F16E6DB8000F173B2 /* Build configuration list for PBXNativeTarget "CTCheckbox" */ = { 395 | isa = XCConfigurationList; 396 | buildConfigurations = ( 397 | 6A99A79016E6DB8000F173B2 /* Debug */, 398 | 6A99A79116E6DB8000F173B2 /* Release */, 399 | ); 400 | defaultConfigurationIsVisible = 0; 401 | defaultConfigurationName = Release; 402 | }; 403 | 6A99A7B416E6DBA000F173B2 /* Build configuration list for PBXNativeTarget "CTCheckboxSample" */ = { 404 | isa = XCConfigurationList; 405 | buildConfigurations = ( 406 | 6A99A7B516E6DBA000F173B2 /* Debug */, 407 | 6A99A7B616E6DBA000F173B2 /* Release */, 408 | ); 409 | defaultConfigurationIsVisible = 0; 410 | defaultConfigurationName = Release; 411 | }; 412 | /* End XCConfigurationList section */ 413 | }; 414 | rootObject = 6A99A77916E6DB8000F173B2 /* Project object */; 415 | } 416 | --------------------------------------------------------------------------------