├── Example ├── IPViewController.h ├── IPAppDelegate.h ├── IPDashedLine-Prefix.pch ├── main.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── IPDashedLine-Info.plist ├── IPAppDelegate.m ├── IPViewController.xib ├── IPViewController.m └── IPDashedLine.xcodeproj │ └── project.pbxproj ├── .gitignore ├── LICENSE ├── Code ├── IPDashedBorderedView.h ├── IPDashedLineView.h ├── IPDashedBorderedView.m └── IPDashedLineView.m ├── IPDashedLineView.podspec └── README.md /Example/IPViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IPViewController.h 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IPViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | -------------------------------------------------------------------------------- /Example/IPAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // IPAppDelegate.h 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IPAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/IPDashedLine-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "IPAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([IPAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Intrepid Pursuits LLC 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. -------------------------------------------------------------------------------- /Code/IPDashedBorderedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IPDashedBorderedView.h 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 6/27/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IPDashedBorderedView : UIView 12 | 13 | /** 14 | How many pts into the drawing we start, from the top left. 15 | Default is 0. 16 | */ 17 | @property (assign, nonatomic) CGFloat phase UI_APPEARANCE_SELECTOR; 18 | 19 | /** 20 | Passing an array with the values [2,3] sets a dash pattern that alternates between a 21 | 2 pt lineColor painted segment and a 3 pt backgroundColor unpainted 22 | segment. Passing the values [1,3,4,2] sets the pattern to a 1-unit painted segment, 23 | a 3-unit unpainted segment, a 4-unit painted segment, and a 2-unit unpainted segment. 24 | Default is @[@2, @2]. 25 | */ 26 | @property (strong, nonatomic) NSArray *lengthPattern UI_APPEARANCE_SELECTOR; 27 | 28 | /** 29 | Color of the dashes. Use backgroundColor for the non-dash color. 30 | Default is black. 31 | */ 32 | @property (strong, nonatomic) UIColor *lineColor UI_APPEARANCE_SELECTOR; 33 | 34 | /** 35 | Width of the dashed lines. 36 | Default is 1. 37 | */ 38 | @property (assign, nonatomic) CGFloat borderWidth UI_APPEARANCE_SELECTOR; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Example/IPDashedLine-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | io.intrepid.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /IPDashedLineView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "IPDashedLineView" 3 | s.version = "1.1.0" 4 | s.summary = "Simple dashed lines." 5 | s.homepage = "https://github.com/IntrepidPursuits/IPDashedLineView" 6 | s.license = { 7 | :type => 'MIT', 8 | :text => <<-LICENSE 9 | Copyright (C) 2012 by Intrepid Pursuits 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 12 | and associated documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, modify, merge, publish, 14 | distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 15 | Software is furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all copies or 18 | substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 21 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 23 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | LICENSE 26 | } 27 | s.author = { "Colin Brash" => "colin3@intrepid.io" } 28 | s.source = { 29 | :git => "https://github.com/IntrepidPursuits/IPDashedLineView.git", 30 | :tag => "1.1.0" 31 | } 32 | s.platform = :ios, '6.1' 33 | s.source_files = 'Code/*.{h,m}' 34 | s.requires_arc = true 35 | end 36 | -------------------------------------------------------------------------------- /Code/IPDashedLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IPDashedLineView.h 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | typedef NS_ENUM(NSInteger, IPDashedLineViewDirection) { 13 | IPDashedLineViewDirectionAutomatic = 0, 14 | IPDashedLineViewDirectionHorizontalFromLeft, 15 | IPDashedLineViewDirectionHorizontalFromRight, 16 | IPDashedLineViewDirectionVerticalFromTop, 17 | IPDashedLineViewDirectionVerticalFromBottom, 18 | }; 19 | 20 | 21 | /** 22 | UIView with a customizable dashed look, generally used for dashed lines. 23 | */ 24 | @interface IPDashedLineView : UIView 25 | 26 | /** 27 | Forced direction of the line if this is not Automatic. 28 | Default is BBDashedLineViewDirectionAutomatic. This will auto select 29 | HorizontalFromLeft or VerticalFromTop depending on width vs height ratio. 30 | */ 31 | @property (assign, nonatomic) IPDashedLineViewDirection direction UI_APPEARANCE_SELECTOR; 32 | 33 | /** 34 | How many pts into the drawing we start. 35 | Default is 0. 36 | */ 37 | @property (assign, nonatomic) CGFloat phase UI_APPEARANCE_SELECTOR; 38 | 39 | /** 40 | Passing an array with the values [2,3] sets a dash pattern that alternates between a 41 | 2 pt lineColor painted segment and a 3 pt backgroundColor unpainted 42 | segment. Passing the values [1,3,4,2] sets the pattern to a 1-unit painted segment, 43 | a 3-unit unpainted segment, a 4-unit painted segment, and a 2-unit unpainted segment. 44 | Default is @[@2, @2]. 45 | */ 46 | @property (strong, nonatomic) NSArray *lengthPattern UI_APPEARANCE_SELECTOR; 47 | 48 | /** 49 | Color of the dashes. Use backgroundColor for the non-dash color. 50 | Default is black. 51 | */ 52 | @property (strong, nonatomic) UIColor *lineColor UI_APPEARANCE_SELECTOR; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Code/IPDashedBorderedView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IPDashedBorderedView.m 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 6/27/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import "IPDashedBorderedView.h" 10 | 11 | @implementation IPDashedBorderedView 12 | 13 | - (id)initWithCoder:(NSCoder *)aDecoder { 14 | self = [super initWithCoder:aDecoder]; 15 | if (self) { 16 | [self commonInit]; 17 | } 18 | return self; 19 | } 20 | 21 | - (id)initWithFrame:(CGRect)frame { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | [self commonInit]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)commonInit { 30 | self.backgroundColor = [UIColor clearColor]; 31 | _phase = 0.0; 32 | _lineColor = [UIColor blackColor]; 33 | _lengthPattern = @[@2, @2]; 34 | _borderWidth = 1.0; 35 | } 36 | 37 | #pragma mark - 38 | 39 | - (void)drawRect:(CGRect)rect { 40 | [super drawRect:rect]; 41 | 42 | CGContextRef context = UIGraphicsGetCurrentContext(); 43 | 44 | CGContextSetLineWidth(context, self.borderWidth * [UIScreen mainScreen].scale); 45 | CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor); 46 | 47 | int count = (int)[self.lengthPattern count]; 48 | CGFloat cArrayLengthPattern[count]; 49 | for (int i = 0; i < count; ++i) { 50 | cArrayLengthPattern[i] = (CGFloat)[self.lengthPattern[i] floatValue]; 51 | } 52 | 53 | CGContextSetLineDash(context, self.phase, cArrayLengthPattern, count); 54 | CGContextMoveToPoint(context, rect.origin.x, rect.origin.y); 55 | CGContextAddLineToPoint(context, CGRectGetMaxX(rect), rect.origin.y); 56 | CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); 57 | CGContextAddLineToPoint(context, rect.origin.x, CGRectGetMaxY(rect)); 58 | CGContextAddLineToPoint(context, rect.origin.x, rect.origin.y); 59 | CGContextStrokePath(context); 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Example/IPAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // IPAppDelegate.m 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import "IPAppDelegate.h" 10 | #import "IPViewController.h" 11 | 12 | @implementation IPAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | self.window.rootViewController = [[IPViewController alloc] initWithNibName:nil bundle:nil]; 18 | self.window.backgroundColor = [UIColor whiteColor]; 19 | [self.window makeKeyAndVisible]; 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | // 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. 26 | // 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. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application 30 | { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(UIApplication *)application 36 | { 37 | // 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. 38 | } 39 | 40 | - (void)applicationDidBecomeActive:(UIApplication *)application 41 | { 42 | // 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. 43 | } 44 | 45 | - (void)applicationWillTerminate:(UIApplication *)application 46 | { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/IPViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IPDashedLineView 2 | 3 | IPDashedLineView provides a simple interface for creating dashed lines. It can be instantiated in code with `-initWithFrame:` or in a nib. 4 | 5 | ![Screenshot](http://i.imgur.com/ROnEND9.png?1) 6 | 7 | ## Example Usage 8 | 9 | // Forced Horizontal 10 | IPDashedLineView *dash1 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(20, 60, 200, 1)]; 11 | dash1.direction = IPDashedLineViewDirectionHorizontalFromRight; 12 | dash1.lineColor = [UIColor blackColor]; 13 | dash1.lengthPattern = @[@1, @1]; 14 | [self.view addSubview:dash1]; 15 | 16 | // Vertical 17 | IPDashedLineView *dash2 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(20, 100, 4, 200)]; 18 | dash2.lengthPattern = @[@4, @4]; 19 | dash2.lineColor = [UIColor orangeColor]; 20 | [self.view addSubview:dash2]; 21 | 22 | // Horizontal 23 | IPDashedLineView *dash3 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(40, 100, 200, 4)]; 24 | dash3.lengthPattern = @[@2, @4]; 25 | dash3.lineColor = [UIColor greenColor]; 26 | [self.view addSubview:dash3]; 27 | 28 | // Forced Vertical 29 | IPDashedLineView *dash4 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(40, 300, 6, 200)]; 30 | dash4.lengthPattern = @[@1, @1, @10, @1, @1, @6,]; 31 | dash4.phase = 7; 32 | dash4.lineColor = [UIColor redColor]; 33 | dash4.backgroundColor = [UIColor blueColor]; 34 | dash4.direction = IPDashedLineViewDirectionVerticalFromBottom; 35 | [self.view addSubview:dash4]; 36 | 37 | // Forced Vertical (looks like a bunch of horizontal lines) 38 | IPDashedLineView *dash5 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(60, 300, 200, 20)]; 39 | dash5.lengthPattern = @[@1, @1]; 40 | dash5.lineColor = [UIColor purpleColor]; 41 | dash5.direction = IPDashedLineViewDirectionVerticalFromTop; 42 | [self.view addSubview:dash5]; 43 | 44 | // Bordered View 45 | IPDashedBorderedView *borderedView1 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(60, 140, 200, 100)]; 46 | borderedView1.borderWidth = 5; 47 | borderedView1.lineColor = [UIColor orangeColor]; 48 | borderedView1.lengthPattern = @[@5, @5]; 49 | borderedView1.backgroundColor = [UIColor blueColor]; 50 | [self.view addSubview:borderedView1]; 51 | 52 | // Bordered View 53 | IPDashedBorderedView *borderedView2 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(120, 180, 40, 40)]; 54 | borderedView2.borderWidth = 1; 55 | borderedView2.lineColor = [UIColor whiteColor]; 56 | borderedView2.lengthPattern = @[@1, @1]; 57 | borderedView2.backgroundColor = [UIColor clearColor]; 58 | [self.view addSubview:borderedView2]; 59 | 60 | // Bordered View 61 | IPDashedBorderedView *borderedView3 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(180, 180, 40, 40)]; 62 | borderedView3.borderWidth = 1; 63 | borderedView3.lineColor = [UIColor lightGrayColor]; 64 | borderedView3.lengthPattern = @[@1, @3]; 65 | borderedView3.backgroundColor = [UIColor clearColor]; 66 | [self.view addSubview:borderedView3]; -------------------------------------------------------------------------------- /Code/IPDashedLineView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IPDashedLineView.m 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import "IPDashedLineView.h" 10 | 11 | @implementation IPDashedLineView 12 | 13 | - (id)initWithCoder:(NSCoder *)aDecoder { 14 | self = [super initWithCoder:aDecoder]; 15 | if (self) { 16 | [self commonInit]; 17 | } 18 | return self; 19 | } 20 | 21 | - (id)initWithFrame:(CGRect)frame { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | [self commonInit]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)commonInit { 30 | self.backgroundColor = [UIColor clearColor]; 31 | _direction = IPDashedLineViewDirectionAutomatic; 32 | _phase = 0; 33 | _lineColor = [UIColor blackColor]; 34 | _lengthPattern = @[@2, @2]; 35 | } 36 | 37 | #pragma mark - 38 | 39 | - (void)drawRect:(CGRect)rect { 40 | [super drawRect:rect]; 41 | 42 | IPDashedLineViewDirection direction = self.direction; 43 | 44 | BOOL isVertical = (self.direction == IPDashedLineViewDirectionVerticalFromTop || self.direction == IPDashedLineViewDirectionVerticalFromBottom); 45 | if (direction == IPDashedLineViewDirectionAutomatic) { 46 | isVertical = (rect.size.height > rect.size.width); 47 | direction = (isVertical ? IPDashedLineViewDirectionVerticalFromTop : IPDashedLineViewDirectionHorizontalFromLeft); 48 | } 49 | 50 | CGFloat borderWidth = (isVertical ? rect.size.width : rect.size.height) * [UIScreen mainScreen].scale; 51 | 52 | CGPoint startPoint; 53 | CGPoint endPoint; 54 | switch (direction) { 55 | case IPDashedLineViewDirectionHorizontalFromLeft: 56 | startPoint = CGPointMake(rect.origin.x, rect.origin.y); 57 | endPoint = CGPointMake(CGRectGetMaxX(rect), rect.origin.y); 58 | break; 59 | case IPDashedLineViewDirectionHorizontalFromRight: 60 | startPoint = CGPointMake(CGRectGetMaxX(rect), rect.origin.y); 61 | endPoint = CGPointMake(rect.origin.x, rect.origin.y); 62 | break; 63 | case IPDashedLineViewDirectionVerticalFromTop: 64 | startPoint = CGPointMake(rect.origin.x, rect.origin.y); 65 | endPoint = CGPointMake(rect.origin.x, CGRectGetMaxY(rect)); 66 | break; 67 | case IPDashedLineViewDirectionVerticalFromBottom: 68 | startPoint = CGPointMake(rect.origin.x, CGRectGetMaxY(rect)); 69 | endPoint = CGPointMake(rect.origin.x, rect.origin.y); 70 | break; 71 | 72 | default: 73 | startPoint = CGPointMake(rect.origin.x, rect.origin.y); 74 | endPoint = CGPointMake(rect.origin.x, rect.origin.y); 75 | } 76 | 77 | CGContextRef context = UIGraphicsGetCurrentContext(); 78 | 79 | CGContextSetLineWidth(context, borderWidth); 80 | CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor); 81 | 82 | int count = (int)[self.lengthPattern count]; 83 | CGFloat cArrayLengthPattern[count]; 84 | for (int i = 0; i < count; ++i) { 85 | cArrayLengthPattern[i] = (CGFloat)[self.lengthPattern[i] floatValue]; 86 | } 87 | 88 | CGContextSetLineDash(context, self.phase, cArrayLengthPattern, count); 89 | CGContextMoveToPoint(context, startPoint.x, startPoint.y); 90 | CGContextAddLineToPoint(context, endPoint.x, endPoint.y); 91 | CGContextStrokePath(context); 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Example/IPViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // IPViewController.m 3 | // IPDashedLine 4 | // 5 | // Created by Colin Brash on 5/30/14. 6 | // Copyright (c) 2014 Intrepid Pursuits. All rights reserved. 7 | // 8 | 9 | #import "IPViewController.h" 10 | #import "IPDashedLineView.h" 11 | #import "IPDashedBorderedView.h" 12 | 13 | 14 | @implementation IPViewController 15 | 16 | - (void)viewDidLoad 17 | { 18 | [super viewDidLoad]; 19 | 20 | IPDashedLineView *appearance = [IPDashedLineView appearance]; 21 | [appearance setLineColor:[UIColor redColor]]; 22 | [appearance setLengthPattern:@[@4, @2]]; 23 | 24 | self.view.backgroundColor = [UIColor whiteColor]; 25 | 26 | // Using appearance 27 | IPDashedLineView *dash0 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(10, 30, 200, 1)]; 28 | [self.view addSubview:dash0]; 29 | 30 | // Forced Horizontal 31 | IPDashedLineView *dash1 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(20, 60, 200, 1)]; 32 | dash1.direction = IPDashedLineViewDirectionHorizontalFromRight; 33 | dash1.lineColor = [UIColor blackColor]; 34 | dash1.lengthPattern = @[@1, @1]; 35 | [self.view addSubview:dash1]; 36 | 37 | // Vertical 38 | IPDashedLineView *dash2 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(20, 100, 4, 200)]; 39 | dash2.lengthPattern = @[@4, @4]; 40 | dash2.lineColor = [UIColor orangeColor]; 41 | [self.view addSubview:dash2]; 42 | 43 | // Horizontal 44 | IPDashedLineView *dash3 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(40, 100, 200, 4)]; 45 | dash3.lengthPattern = @[@2, @4]; 46 | dash3.lineColor = [UIColor greenColor]; 47 | [self.view addSubview:dash3]; 48 | 49 | // Forced Vertical 50 | IPDashedLineView *dash4 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(40, 300, 6, 200)]; 51 | dash4.lengthPattern = @[@1, @1, @10, @1, @1, @6,]; 52 | dash4.phase = 7; 53 | dash4.lineColor = [UIColor redColor]; 54 | dash4.backgroundColor = [UIColor blueColor]; 55 | dash4.direction = IPDashedLineViewDirectionVerticalFromBottom; 56 | [self.view addSubview:dash4]; 57 | 58 | // Forced Vertical (looks like a bunch of horizontal lines) 59 | IPDashedLineView *dash5 = [[IPDashedLineView alloc] initWithFrame:CGRectMake(60, 300, 200, 20)]; 60 | dash5.lengthPattern = @[@1, @1]; 61 | dash5.lineColor = [UIColor purpleColor]; 62 | dash5.direction = IPDashedLineViewDirectionVerticalFromTop; 63 | [self.view addSubview:dash5]; 64 | 65 | // Bordered View 66 | IPDashedBorderedView *borderedView1 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(60, 140, 200, 100)]; 67 | borderedView1.borderWidth = 5; 68 | borderedView1.lineColor = [UIColor orangeColor]; 69 | borderedView1.lengthPattern = @[@5, @5]; 70 | borderedView1.backgroundColor = [UIColor blueColor]; 71 | [self.view addSubview:borderedView1]; 72 | 73 | // Bordered View 74 | IPDashedBorderedView *borderedView2 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(120, 180, 40, 40)]; 75 | borderedView2.borderWidth = 1; 76 | borderedView2.lineColor = [UIColor whiteColor]; 77 | borderedView2.lengthPattern = @[@1, @1]; 78 | borderedView2.backgroundColor = [UIColor clearColor]; 79 | [self.view addSubview:borderedView2]; 80 | 81 | // Bordered View 82 | IPDashedBorderedView *borderedView3 = [[IPDashedBorderedView alloc] initWithFrame:CGRectMake(180, 180, 40, 40)]; 83 | borderedView3.borderWidth = 1; 84 | borderedView3.lineColor = [UIColor lightGrayColor]; 85 | borderedView3.lengthPattern = @[@1, @3]; 86 | borderedView3.backgroundColor = [UIColor clearColor]; 87 | [self.view addSubview:borderedView3]; 88 | } 89 | @end 90 | -------------------------------------------------------------------------------- /Example/IPDashedLine.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4900EAD4195DF21E00D93D1A /* IPDashedBorderedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4900EAD3195DF21E00D93D1A /* IPDashedBorderedView.m */; }; 11 | 4900EAD6195DF35F00D93D1A /* IPViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4900EAD5195DF35F00D93D1A /* IPViewController.xib */; }; 12 | 4983FDE81958AA4A00247750 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4983FDE71958AA4A00247750 /* Images.xcassets */; }; 13 | 49F32A28193913B6007B882F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49F32A27193913B6007B882F /* Foundation.framework */; }; 14 | 49F32A2A193913B6007B882F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49F32A29193913B6007B882F /* CoreGraphics.framework */; }; 15 | 49F32A2C193913B6007B882F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49F32A2B193913B6007B882F /* UIKit.framework */; }; 16 | 49F32A34193913B6007B882F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F32A33193913B6007B882F /* main.m */; }; 17 | 49F32A38193913B6007B882F /* IPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F32A37193913B6007B882F /* IPAppDelegate.m */; }; 18 | 49F32A41193913B6007B882F /* IPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F32A40193913B6007B882F /* IPViewController.m */; }; 19 | 49F32A61193913CE007B882F /* IPDashedLineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F32A60193913CE007B882F /* IPDashedLineView.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 4900EAD2195DF21E00D93D1A /* IPDashedBorderedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPDashedBorderedView.h; sourceTree = ""; }; 24 | 4900EAD3195DF21E00D93D1A /* IPDashedBorderedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPDashedBorderedView.m; sourceTree = ""; }; 25 | 4900EAD5195DF35F00D93D1A /* IPViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IPViewController.xib; sourceTree = ""; }; 26 | 4983FDE71958AA4A00247750 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 27 | 49F32A24193913B6007B882F /* IPDashedLine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IPDashedLine.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 49F32A27193913B6007B882F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29 | 49F32A29193913B6007B882F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | 49F32A2B193913B6007B882F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 31 | 49F32A2F193913B6007B882F /* IPDashedLine-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IPDashedLine-Info.plist"; sourceTree = ""; }; 32 | 49F32A33193913B6007B882F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 49F32A35193913B6007B882F /* IPDashedLine-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IPDashedLine-Prefix.pch"; sourceTree = ""; }; 34 | 49F32A36193913B6007B882F /* IPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPAppDelegate.h; sourceTree = ""; }; 35 | 49F32A37193913B6007B882F /* IPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IPAppDelegate.m; sourceTree = ""; }; 36 | 49F32A3F193913B6007B882F /* IPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPViewController.h; sourceTree = ""; }; 37 | 49F32A40193913B6007B882F /* IPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IPViewController.m; sourceTree = ""; }; 38 | 49F32A5F193913CE007B882F /* IPDashedLineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPDashedLineView.h; sourceTree = ""; }; 39 | 49F32A60193913CE007B882F /* IPDashedLineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPDashedLineView.m; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 49F32A21193913B6007B882F /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | 49F32A2A193913B6007B882F /* CoreGraphics.framework in Frameworks */, 48 | 49F32A2C193913B6007B882F /* UIKit.framework in Frameworks */, 49 | 49F32A28193913B6007B882F /* Foundation.framework in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 4900EAD1195DF20C00D93D1A /* Code */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 49F32A5F193913CE007B882F /* IPDashedLineView.h */, 60 | 49F32A60193913CE007B882F /* IPDashedLineView.m */, 61 | 4900EAD2195DF21E00D93D1A /* IPDashedBorderedView.h */, 62 | 4900EAD3195DF21E00D93D1A /* IPDashedBorderedView.m */, 63 | ); 64 | name = Code; 65 | path = ../Code; 66 | sourceTree = ""; 67 | }; 68 | 49F32A1B193913B6007B882F = { 69 | isa = PBXGroup; 70 | children = ( 71 | 4900EAD1195DF20C00D93D1A /* Code */, 72 | 49F32A2D193913B6007B882F /* Example */, 73 | 49F32A26193913B6007B882F /* Frameworks */, 74 | 49F32A25193913B6007B882F /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 49F32A25193913B6007B882F /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 49F32A24193913B6007B882F /* IPDashedLine.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 49F32A26193913B6007B882F /* Frameworks */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 49F32A27193913B6007B882F /* Foundation.framework */, 90 | 49F32A29193913B6007B882F /* CoreGraphics.framework */, 91 | 49F32A2B193913B6007B882F /* UIKit.framework */, 92 | ); 93 | name = Frameworks; 94 | sourceTree = ""; 95 | }; 96 | 49F32A2D193913B6007B882F /* Example */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 49F32A36193913B6007B882F /* IPAppDelegate.h */, 100 | 49F32A37193913B6007B882F /* IPAppDelegate.m */, 101 | 49F32A3F193913B6007B882F /* IPViewController.h */, 102 | 49F32A40193913B6007B882F /* IPViewController.m */, 103 | 4900EAD5195DF35F00D93D1A /* IPViewController.xib */, 104 | 4983FDE71958AA4A00247750 /* Images.xcassets */, 105 | 49F32A2E193913B6007B882F /* Supporting Files */, 106 | ); 107 | name = Example; 108 | sourceTree = ""; 109 | }; 110 | 49F32A2E193913B6007B882F /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 49F32A2F193913B6007B882F /* IPDashedLine-Info.plist */, 114 | 49F32A33193913B6007B882F /* main.m */, 115 | 49F32A35193913B6007B882F /* IPDashedLine-Prefix.pch */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | /* End PBXGroup section */ 121 | 122 | /* Begin PBXNativeTarget section */ 123 | 49F32A23193913B6007B882F /* IPDashedLine */ = { 124 | isa = PBXNativeTarget; 125 | buildConfigurationList = 49F32A59193913B6007B882F /* Build configuration list for PBXNativeTarget "IPDashedLine" */; 126 | buildPhases = ( 127 | 49F32A20193913B6007B882F /* Sources */, 128 | 49F32A21193913B6007B882F /* Frameworks */, 129 | 49F32A22193913B6007B882F /* Resources */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | ); 135 | name = IPDashedLine; 136 | productName = IPDashedLine; 137 | productReference = 49F32A24193913B6007B882F /* IPDashedLine.app */; 138 | productType = "com.apple.product-type.application"; 139 | }; 140 | /* End PBXNativeTarget section */ 141 | 142 | /* Begin PBXProject section */ 143 | 49F32A1C193913B6007B882F /* Project object */ = { 144 | isa = PBXProject; 145 | attributes = { 146 | CLASSPREFIX = IP; 147 | LastUpgradeCheck = 0510; 148 | ORGANIZATIONNAME = "Intrepid Pursuits"; 149 | }; 150 | buildConfigurationList = 49F32A1F193913B6007B882F /* Build configuration list for PBXProject "IPDashedLine" */; 151 | compatibilityVersion = "Xcode 3.2"; 152 | developmentRegion = English; 153 | hasScannedForEncodings = 0; 154 | knownRegions = ( 155 | en, 156 | Base, 157 | ); 158 | mainGroup = 49F32A1B193913B6007B882F; 159 | productRefGroup = 49F32A25193913B6007B882F /* Products */; 160 | projectDirPath = ""; 161 | projectRoot = ""; 162 | targets = ( 163 | 49F32A23193913B6007B882F /* IPDashedLine */, 164 | ); 165 | }; 166 | /* End PBXProject section */ 167 | 168 | /* Begin PBXResourcesBuildPhase section */ 169 | 49F32A22193913B6007B882F /* Resources */ = { 170 | isa = PBXResourcesBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 4983FDE81958AA4A00247750 /* Images.xcassets in Resources */, 174 | 4900EAD6195DF35F00D93D1A /* IPViewController.xib in Resources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXResourcesBuildPhase section */ 179 | 180 | /* Begin PBXSourcesBuildPhase section */ 181 | 49F32A20193913B6007B882F /* Sources */ = { 182 | isa = PBXSourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | 4900EAD4195DF21E00D93D1A /* IPDashedBorderedView.m in Sources */, 186 | 49F32A34193913B6007B882F /* main.m in Sources */, 187 | 49F32A61193913CE007B882F /* IPDashedLineView.m in Sources */, 188 | 49F32A38193913B6007B882F /* IPAppDelegate.m in Sources */, 189 | 49F32A41193913B6007B882F /* IPViewController.m in Sources */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXSourcesBuildPhase section */ 194 | 195 | /* Begin XCBuildConfiguration section */ 196 | 49F32A57193913B6007B882F /* Debug */ = { 197 | isa = XCBuildConfiguration; 198 | buildSettings = { 199 | ALWAYS_SEARCH_USER_PATHS = NO; 200 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 201 | CLANG_CXX_LIBRARY = "libc++"; 202 | CLANG_ENABLE_MODULES = YES; 203 | CLANG_ENABLE_OBJC_ARC = YES; 204 | CLANG_WARN_BOOL_CONVERSION = YES; 205 | CLANG_WARN_CONSTANT_CONVERSION = YES; 206 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 207 | CLANG_WARN_EMPTY_BODY = YES; 208 | CLANG_WARN_ENUM_CONVERSION = YES; 209 | CLANG_WARN_INT_CONVERSION = YES; 210 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 211 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 212 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 213 | COPY_PHASE_STRIP = NO; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_OPTIMIZATION_LEVEL = 0; 217 | GCC_PREPROCESSOR_DEFINITIONS = ( 218 | "DEBUG=1", 219 | "$(inherited)", 220 | ); 221 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 229 | ONLY_ACTIVE_ARCH = YES; 230 | SDKROOT = iphoneos; 231 | TARGETED_DEVICE_FAMILY = "1,2"; 232 | }; 233 | name = Debug; 234 | }; 235 | 49F32A58193913B6007B882F /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BOOL_CONVERSION = YES; 244 | CLANG_WARN_CONSTANT_CONVERSION = YES; 245 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 246 | CLANG_WARN_EMPTY_BODY = YES; 247 | CLANG_WARN_ENUM_CONVERSION = YES; 248 | CLANG_WARN_INT_CONVERSION = YES; 249 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 252 | COPY_PHASE_STRIP = YES; 253 | ENABLE_NS_ASSERTIONS = NO; 254 | GCC_C_LANGUAGE_STANDARD = gnu99; 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 257 | GCC_WARN_UNDECLARED_SELECTOR = YES; 258 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 259 | GCC_WARN_UNUSED_FUNCTION = YES; 260 | GCC_WARN_UNUSED_VARIABLE = YES; 261 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 262 | SDKROOT = iphoneos; 263 | TARGETED_DEVICE_FAMILY = "1,2"; 264 | VALIDATE_PRODUCT = YES; 265 | }; 266 | name = Release; 267 | }; 268 | 49F32A5A193913B6007B882F /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 272 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 273 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 274 | GCC_PREFIX_HEADER = "IPDashedLine-Prefix.pch"; 275 | INFOPLIST_FILE = "IPDashedLine-Info.plist"; 276 | PRODUCT_NAME = "$(TARGET_NAME)"; 277 | WRAPPER_EXTENSION = app; 278 | }; 279 | name = Debug; 280 | }; 281 | 49F32A5B193913B6007B882F /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 286 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 287 | GCC_PREFIX_HEADER = "IPDashedLine-Prefix.pch"; 288 | INFOPLIST_FILE = "IPDashedLine-Info.plist"; 289 | PRODUCT_NAME = "$(TARGET_NAME)"; 290 | WRAPPER_EXTENSION = app; 291 | }; 292 | name = Release; 293 | }; 294 | /* End XCBuildConfiguration section */ 295 | 296 | /* Begin XCConfigurationList section */ 297 | 49F32A1F193913B6007B882F /* Build configuration list for PBXProject "IPDashedLine" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | 49F32A57193913B6007B882F /* Debug */, 301 | 49F32A58193913B6007B882F /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | 49F32A59193913B6007B882F /* Build configuration list for PBXNativeTarget "IPDashedLine" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | 49F32A5A193913B6007B882F /* Debug */, 310 | 49F32A5B193913B6007B882F /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | defaultConfigurationName = Release; 314 | }; 315 | /* End XCConfigurationList section */ 316 | }; 317 | rootObject = 49F32A1C193913B6007B882F /* Project object */; 318 | } 319 | --------------------------------------------------------------------------------