├── GBPathImageExample ├── GBPathImage │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── ViewController.xib │ ├── me.png │ ├── Default.png │ ├── Default@2x.png │ ├── Default-568h@2x.png │ ├── ViewController.h │ ├── GBPathImage-Prefix.pch │ ├── main.m │ ├── AppDelegate.h │ ├── GBPathImageView.h │ ├── GBPathImage-Info.plist │ ├── AppDelegate.m │ ├── ViewController.m │ └── GBPathImageView.m └── GBPathImage.xcodeproj │ └── project.pbxproj ├── .gitignore ├── GBPathImageView.h ├── LICENSE ├── README.md └── GBPathImageView.m /GBPathImageExample/GBPathImage/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matteogobbi/GBPathImageView/HEAD/GBPathImageExample/GBPathImage/me.png -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matteogobbi/GBPathImageView/HEAD/GBPathImageExample/GBPathImage/Default.png -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matteogobbi/GBPathImageView/HEAD/GBPathImageExample/GBPathImage/Default@2x.png -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matteogobbi/GBPathImageView/HEAD/GBPathImageExample/GBPathImage/Default-568h@2x.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GBPathImage 4 | // 5 | // Created by Matteo Gobbi on 16/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "GBPathImageView.h" 11 | 12 | @interface ViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/GBPathImage-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'GBPathImage' target in the 'GBPathImage' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GBPathImage 4 | // 5 | // Created by Matteo Gobbi on 16/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GBPathImage 4 | // 5 | // Created by Matteo Gobbi on 16/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /GBPathImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GBPathImageView.h 3 | // GBControls 4 | // 5 | // Created by Matteo Gobbi on 15/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | GBPathImageViewTypeCircle, 13 | GBPathImageViewTypeSquare 14 | } GBPathImageViewType; 15 | 16 | 17 | @interface GBPathImageView : UIImageView 18 | 19 | @property (nonatomic) GBPathImageViewType pathType; 20 | @property (nonatomic, strong) UIColor *borderColor; 21 | @property (nonatomic, strong) UIColor *pathColor; 22 | @property float pathWidth; 23 | 24 | 25 | - (id)initWithFrame:(CGRect)frame 26 | image:(UIImage *)image; 27 | 28 | - (id)initWithFrame:(CGRect)frame 29 | image:(UIImage *)image 30 | pathType:(GBPathImageViewType)pathType 31 | pathColor:(UIColor *)pathColor 32 | borderColor:(UIColor *)borderColor 33 | pathWidth:(float)pathWidth; 34 | 35 | 36 | - (void)draw; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/GBPathImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GBPathImageView.h 3 | // GBControls 4 | // 5 | // Created by Matteo Gobbi on 15/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | GBPathImageViewTypeCircle, 13 | GBPathImageViewTypeSquare 14 | } GBPathImageViewType; 15 | 16 | 17 | @interface GBPathImageView : UIImageView 18 | 19 | @property (nonatomic) GBPathImageViewType pathType; 20 | @property (nonatomic, strong) UIColor *borderColor; 21 | @property (nonatomic, strong) UIColor *pathColor; 22 | @property float pathWidth; 23 | 24 | 25 | - (id)initWithFrame:(CGRect)frame 26 | image:(UIImage *)image; 27 | 28 | - (id)initWithFrame:(CGRect)frame 29 | image:(UIImage *)image 30 | pathType:(GBPathImageViewType)pathType 31 | pathColor:(UIColor *)pathColor 32 | borderColor:(UIColor *)borderColor 33 | pathWidth:(float)pathWidth; 34 | 35 | 36 | - (void)draw; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Matteo Gobbi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/GBPathImage-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.matteogobbi.${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 | 38 | 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GBPathImageView 2 | =============== 3 | 4 | With this class, you can get images in the circles or squares with the border. 5 | 6 | ![GBPathImageView screenshot](https://s3.amazonaws.com/cocoacontrols_production/uploads/control_image/image/1663/Schermata_2013-08-16_alle_01.34.51.png "GBPathImageView Screenshot") 7 | 8 | ## Example Usage 9 | 10 | This is an easy example to init the control from code: 11 | 12 | ``` objective-c 13 | GBPathImageView *squareImage = [[GBPathImageView alloc] initWithFrame:CGRectMake(26, 117, 130, 130) image:[UIImage imageNamed:@"me.png"] pathType:GBPathImageViewTypeSquare pathColor:[UIColor orangeColor] borderColor:[UIColor redColor] pathWidth:6.0]; 14 | [self.view addSubview:squareImage]; 15 | ``` 16 | 17 | Or get from nib, set params (or leave default) and start the draw method 18 | 19 | ``` objective-c 20 | GBPathImageView *img1 = (GBPathImageView *)[self.view viewWithTag:1]; 21 | [img1 setPathColor:[UIColor yellowColor]]; 22 | [img1 setBorderColor:[UIColor blackColor]]; 23 | [img1 setPathWidth:6.0]; 24 | [img1 setPathType:GBPathImageViewTypeCircle]; 25 | [img1 draw]; 26 | ``` 27 | 28 | See the example's project. 29 | 30 | 31 | ## Contact 32 | 33 | Matteo Gobbi 34 | 35 | - http://www.matteogobbi.it 36 | - http://github.com/matteogobbi 37 | - http://twitter.com/matteo_gobbi 38 | - https://angel.co/matteo-gobbi 39 | - http://www.linkedin.com/profile/view?id=24211474 40 | 41 | ## License 42 | 43 | GBPathImageView is available under the MIT license. 44 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GBPathImage 4 | // 5 | // Created by Matteo Gobbi on 16/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // 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. 28 | // 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. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // 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. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // 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. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GBPathImage 4 | // 5 | // Created by Matteo Gobbi on 16/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | 21 | 22 | //You can easy init and add pathImage from code 23 | GBPathImageView *squareImage = [[GBPathImageView alloc] initWithFrame:CGRectMake(26, 117, 130, 130) image:[UIImage imageNamed:@"me.png"] pathType:GBPathImageViewTypeSquare pathColor:[UIColor orangeColor] borderColor:[UIColor redColor] pathWidth:6.0]; 24 | [self.view addSubview:squareImage]; 25 | 26 | 27 | //Or get from nib, set params (or leave default) and start the draw method 28 | GBPathImageView *img1 = (GBPathImageView *)[self.view viewWithTag:1]; 29 | [img1 setPathColor:[UIColor yellowColor]]; 30 | [img1 setBorderColor:[UIColor blackColor]]; 31 | [img1 setPathWidth:6.0]; 32 | [img1 setPathType:GBPathImageViewTypeCircle]; 33 | [img1 draw]; 34 | 35 | GBPathImageView *img2 = (GBPathImageView *)[self.view viewWithTag:2]; 36 | [img2 setPathColor:[UIColor whiteColor]]; 37 | [img2 setBorderColor:[UIColor darkGrayColor]]; 38 | [img2 setPathWidth:4.5]; 39 | [img2 setPathType:GBPathImageViewTypeCircle]; 40 | [img2 draw]; 41 | 42 | GBPathImageView *img3 = (GBPathImageView *)[self.view viewWithTag:3]; 43 | [img3 setPathColor:[UIColor blackColor]]; 44 | [img3 setBorderColor:[UIColor whiteColor]]; 45 | [img3 setPathWidth:8.0]; 46 | [img3 setPathType:GBPathImageViewTypeSquare]; 47 | [img3 draw]; 48 | 49 | GBPathImageView *img4 = (GBPathImageView *)[self.view viewWithTag:4]; 50 | [img4 setPathColor:[UIColor redColor]]; 51 | [img4 setBorderColor:[UIColor whiteColor]]; 52 | [img4 setPathWidth:10.0]; 53 | [img4 setPathType:GBPathImageViewTypeCircle]; 54 | [img4 draw]; 55 | 56 | GBPathImageView *img5 = (GBPathImageView *)[self.view viewWithTag:5]; 57 | [img5 setPathColor:[UIColor whiteColor]]; 58 | [img5 setBorderColor:[UIColor blackColor]]; 59 | [img5 setPathWidth:5.0]; 60 | [img5 setPathType:GBPathImageViewTypeSquare]; 61 | [img5 draw]; 62 | 63 | GBPathImageView *img6 = (GBPathImageView *)[self.view viewWithTag:6]; 64 | [img6 setPathColor:[UIColor orangeColor]]; 65 | [img6 setBorderColor:[UIColor whiteColor]]; 66 | [img6 setPathWidth:4.0]; 67 | [img6 setPathType:GBPathImageViewTypeCircle]; 68 | [img6 draw]; 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /GBPathImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GBPathImageView.m 3 | // GBControls 4 | // 5 | // Created by Matteo Gobbi on 15/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #define LINE_BORDER_WIDTH 1.0 10 | 11 | #import "GBPathImageView.h" 12 | 13 | @interface GBPathImageView () { 14 | UIImage *originalImage; 15 | } 16 | 17 | @end 18 | 19 | 20 | @implementation GBPathImageView 21 | 22 | - (id)initWithFrame:(CGRect)frame 23 | image:(UIImage *)image 24 | { 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | // Initialization code 28 | originalImage = image; 29 | 30 | [self setDefaultParam]; 31 | 32 | [self draw]; 33 | } 34 | return self; 35 | } 36 | 37 | - (id)initWithFrame:(CGRect)frame 38 | image:(UIImage *)image 39 | pathType:(GBPathImageViewType)pathType 40 | pathColor:(UIColor *)pathColor 41 | borderColor:(UIColor *)borderColor 42 | pathWidth:(float)pathWidth 43 | { 44 | self = [super initWithFrame:frame]; 45 | if (self) { 46 | // Initialization code 47 | originalImage = image; 48 | _pathType = pathType; 49 | _pathColor = pathColor; 50 | _borderColor = borderColor; 51 | _pathWidth = pathWidth; 52 | 53 | [self draw]; 54 | } 55 | return self; 56 | } 57 | 58 | -(void)awakeFromNib { 59 | [super awakeFromNib]; 60 | 61 | originalImage = self.image; 62 | 63 | [self setDefaultParam]; 64 | 65 | [self draw]; 66 | } 67 | 68 | 69 | -(void)draw { 70 | 71 | CGRect rect; 72 | rect.size = self.frame.size; 73 | rect.origin = CGPointMake(0, 0); 74 | 75 | CGRect rectImage = rect; 76 | rectImage.origin.x += _pathWidth; 77 | rectImage.origin.y += _pathWidth; 78 | rectImage.size.width -= _pathWidth*2.0; 79 | rectImage.size.height -= _pathWidth*2.0; 80 | 81 | 82 | UIGraphicsBeginImageContextWithOptions(rect.size,0,0); 83 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 84 | 85 | switch (_pathType) { 86 | case GBPathImageViewTypeCircle: 87 | CGContextAddEllipseInRect(ctx, rect); 88 | break; 89 | case GBPathImageViewTypeSquare: 90 | CGContextAddRect(ctx, rect); 91 | break; 92 | default: 93 | break; 94 | } 95 | 96 | CGContextClip(ctx); 97 | [originalImage drawInRect:rectImage]; 98 | 99 | 100 | 101 | //Add intern and extern line 102 | rectImage.origin.x -= LINE_BORDER_WIDTH/2.0; 103 | rectImage.origin.y -= LINE_BORDER_WIDTH/2.0; 104 | rectImage.size.width += LINE_BORDER_WIDTH; 105 | rectImage.size.height += LINE_BORDER_WIDTH; 106 | 107 | rect.origin.x += LINE_BORDER_WIDTH/2.0; 108 | rect.origin.y += LINE_BORDER_WIDTH/2.0; 109 | rect.size.width -= LINE_BORDER_WIDTH; 110 | rect.size.height -= LINE_BORDER_WIDTH; 111 | 112 | CGContextSetStrokeColorWithColor(ctx, [_borderColor CGColor]); 113 | CGContextSetLineWidth(ctx, LINE_BORDER_WIDTH); 114 | 115 | switch (_pathType) { 116 | case GBPathImageViewTypeCircle: 117 | CGContextStrokeEllipseInRect(ctx, rectImage); 118 | CGContextStrokeEllipseInRect(ctx, rect); 119 | break; 120 | case GBPathImageViewTypeSquare: 121 | CGContextStrokeRect(ctx, rectImage); 122 | CGContextStrokeRect(ctx, rect); 123 | break; 124 | default: 125 | break; 126 | } 127 | 128 | 129 | //Add center line 130 | float centerLineWidth = _pathWidth - LINE_BORDER_WIDTH*2.0; 131 | 132 | rectImage.origin.x -= LINE_BORDER_WIDTH/2.0+centerLineWidth/2.0; 133 | rectImage.origin.y -= LINE_BORDER_WIDTH/2.0+centerLineWidth/2.0; 134 | rectImage.size.width += LINE_BORDER_WIDTH+centerLineWidth; 135 | rectImage.size.height += LINE_BORDER_WIDTH+centerLineWidth; 136 | 137 | CGContextSetStrokeColorWithColor(ctx, [_pathColor CGColor]); 138 | CGContextSetLineWidth(ctx, centerLineWidth); 139 | 140 | switch (_pathType) { 141 | case GBPathImageViewTypeCircle: 142 | CGContextStrokeEllipseInRect(ctx, rectImage); 143 | break; 144 | case GBPathImageViewTypeSquare: 145 | CGContextStrokeRect(ctx, rectImage); 146 | break; 147 | default: 148 | break; 149 | } 150 | 151 | 152 | self.image = UIGraphicsGetImageFromCurrentImageContext(); 153 | 154 | UIGraphicsEndImageContext(); 155 | } 156 | 157 | -(void)setDefaultParam { 158 | _pathType = GBPathImageViewTypeCircle; 159 | _pathColor = [UIColor whiteColor]; 160 | _borderColor = [UIColor darkGrayColor]; 161 | _pathWidth = 5.0; 162 | } 163 | 164 | 165 | @end 166 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/GBPathImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GBPathImageView.m 3 | // GBControls 4 | // 5 | // Created by Matteo Gobbi on 15/08/13. 6 | // Copyright (c) 2013 Matteo Gobbi. All rights reserved. 7 | // 8 | 9 | #define LINE_BORDER_WIDTH 1.0 10 | 11 | #import "GBPathImageView.h" 12 | 13 | @interface GBPathImageView () { 14 | UIImage *originalImage; 15 | } 16 | 17 | @end 18 | 19 | 20 | @implementation GBPathImageView 21 | 22 | - (id)initWithFrame:(CGRect)frame 23 | image:(UIImage *)image 24 | { 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | // Initialization code 28 | originalImage = image; 29 | 30 | [self setDefaultParam]; 31 | 32 | [self draw]; 33 | } 34 | return self; 35 | } 36 | 37 | - (id)initWithFrame:(CGRect)frame 38 | image:(UIImage *)image 39 | pathType:(GBPathImageViewType)pathType 40 | pathColor:(UIColor *)pathColor 41 | borderColor:(UIColor *)borderColor 42 | pathWidth:(float)pathWidth 43 | { 44 | self = [super initWithFrame:frame]; 45 | if (self) { 46 | // Initialization code 47 | originalImage = image; 48 | _pathType = pathType; 49 | _pathColor = pathColor; 50 | _borderColor = borderColor; 51 | _pathWidth = pathWidth; 52 | 53 | [self draw]; 54 | } 55 | return self; 56 | } 57 | 58 | -(void)awakeFromNib { 59 | [super awakeFromNib]; 60 | 61 | originalImage = self.image; 62 | 63 | [self setDefaultParam]; 64 | 65 | [self draw]; 66 | } 67 | 68 | 69 | -(void)draw { 70 | 71 | CGRect rect; 72 | rect.size = self.frame.size; 73 | rect.origin = CGPointMake(0, 0); 74 | 75 | CGRect rectImage = rect; 76 | rectImage.origin.x += _pathWidth; 77 | rectImage.origin.y += _pathWidth; 78 | rectImage.size.width -= _pathWidth*2.0; 79 | rectImage.size.height -= _pathWidth*2.0; 80 | 81 | 82 | UIGraphicsBeginImageContextWithOptions(rect.size,0,0); 83 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 84 | 85 | switch (_pathType) { 86 | case GBPathImageViewTypeCircle: 87 | CGContextAddEllipseInRect(ctx, rect); 88 | break; 89 | case GBPathImageViewTypeSquare: 90 | CGContextAddRect(ctx, rect); 91 | break; 92 | default: 93 | break; 94 | } 95 | 96 | CGContextClip(ctx); 97 | [originalImage drawInRect:rectImage]; 98 | 99 | 100 | 101 | //Add intern and extern line 102 | rectImage.origin.x -= LINE_BORDER_WIDTH/2.0; 103 | rectImage.origin.y -= LINE_BORDER_WIDTH/2.0; 104 | rectImage.size.width += LINE_BORDER_WIDTH; 105 | rectImage.size.height += LINE_BORDER_WIDTH; 106 | 107 | rect.origin.x += LINE_BORDER_WIDTH/2.0; 108 | rect.origin.y += LINE_BORDER_WIDTH/2.0; 109 | rect.size.width -= LINE_BORDER_WIDTH; 110 | rect.size.height -= LINE_BORDER_WIDTH; 111 | 112 | CGContextSetStrokeColorWithColor(ctx, [_borderColor CGColor]); 113 | CGContextSetLineWidth(ctx, LINE_BORDER_WIDTH); 114 | 115 | switch (_pathType) { 116 | case GBPathImageViewTypeCircle: 117 | CGContextStrokeEllipseInRect(ctx, rectImage); 118 | CGContextStrokeEllipseInRect(ctx, rect); 119 | break; 120 | case GBPathImageViewTypeSquare: 121 | CGContextStrokeRect(ctx, rectImage); 122 | CGContextStrokeRect(ctx, rect); 123 | break; 124 | default: 125 | break; 126 | } 127 | 128 | 129 | //Add center line 130 | float centerLineWidth = _pathWidth - LINE_BORDER_WIDTH*2.0; 131 | 132 | rectImage.origin.x -= LINE_BORDER_WIDTH/2.0+centerLineWidth/2.0; 133 | rectImage.origin.y -= LINE_BORDER_WIDTH/2.0+centerLineWidth/2.0; 134 | rectImage.size.width += LINE_BORDER_WIDTH+centerLineWidth; 135 | rectImage.size.height += LINE_BORDER_WIDTH+centerLineWidth; 136 | 137 | CGContextSetStrokeColorWithColor(ctx, [_pathColor CGColor]); 138 | CGContextSetLineWidth(ctx, centerLineWidth); 139 | 140 | switch (_pathType) { 141 | case GBPathImageViewTypeCircle: 142 | CGContextStrokeEllipseInRect(ctx, rectImage); 143 | break; 144 | case GBPathImageViewTypeSquare: 145 | CGContextStrokeRect(ctx, rectImage); 146 | break; 147 | default: 148 | break; 149 | } 150 | 151 | 152 | self.image = UIGraphicsGetImageFromCurrentImageContext(); 153 | 154 | UIGraphicsEndImageContext(); 155 | } 156 | 157 | -(void)setDefaultParam { 158 | _pathType = GBPathImageViewTypeCircle; 159 | _pathColor = [UIColor whiteColor]; 160 | _borderColor = [UIColor darkGrayColor]; 161 | _pathWidth = 5.0; 162 | } 163 | 164 | 165 | @end 166 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 65EF119F17BD98D100BC12DD /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EF119E17BD98D100BC12DD /* UIKit.framework */; }; 11 | 65EF11A117BD98D100BC12DD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EF11A017BD98D100BC12DD /* Foundation.framework */; }; 12 | 65EF11A317BD98D100BC12DD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65EF11A217BD98D100BC12DD /* CoreGraphics.framework */; }; 13 | 65EF11A917BD98D100BC12DD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11A717BD98D100BC12DD /* InfoPlist.strings */; }; 14 | 65EF11AB17BD98D100BC12DD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EF11AA17BD98D100BC12DD /* main.m */; }; 15 | 65EF11AF17BD98D100BC12DD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EF11AE17BD98D100BC12DD /* AppDelegate.m */; }; 16 | 65EF11B117BD98D100BC12DD /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11B017BD98D100BC12DD /* Default.png */; }; 17 | 65EF11B317BD98D100BC12DD /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11B217BD98D100BC12DD /* Default@2x.png */; }; 18 | 65EF11B517BD98D100BC12DD /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11B417BD98D100BC12DD /* Default-568h@2x.png */; }; 19 | 65EF11B817BD98D100BC12DD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EF11B717BD98D100BC12DD /* ViewController.m */; }; 20 | 65EF11BB17BD98D100BC12DD /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11B917BD98D100BC12DD /* ViewController.xib */; }; 21 | 65EF11C217BD98F000BC12DD /* me.png in Resources */ = {isa = PBXBuildFile; fileRef = 65EF11C117BD98F000BC12DD /* me.png */; }; 22 | 65EF11C617BD992500BC12DD /* GBPathImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EF11C417BD992500BC12DD /* GBPathImageView.m */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 65EF119B17BD98D100BC12DD /* GBPathImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GBPathImage.app; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 65EF119E17BD98D100BC12DD /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 65EF11A017BD98D100BC12DD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29 | 65EF11A217BD98D100BC12DD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | 65EF11A617BD98D100BC12DD /* GBPathImage-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GBPathImage-Info.plist"; sourceTree = ""; }; 31 | 65EF11A817BD98D100BC12DD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 32 | 65EF11AA17BD98D100BC12DD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 65EF11AC17BD98D100BC12DD /* GBPathImage-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GBPathImage-Prefix.pch"; sourceTree = ""; }; 34 | 65EF11AD17BD98D100BC12DD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | 65EF11AE17BD98D100BC12DD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | 65EF11B017BD98D100BC12DD /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 37 | 65EF11B217BD98D100BC12DD /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 38 | 65EF11B417BD98D100BC12DD /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 39 | 65EF11B617BD98D100BC12DD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 40 | 65EF11B717BD98D100BC12DD /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 41 | 65EF11BA17BD98D100BC12DD /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; 42 | 65EF11C117BD98F000BC12DD /* me.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = me.png; sourceTree = ""; }; 43 | 65EF11C417BD992500BC12DD /* GBPathImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBPathImageView.m; sourceTree = ""; }; 44 | 65EF11C517BD992500BC12DD /* GBPathImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBPathImageView.h; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 65EF119817BD98D100BC12DD /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | 65EF119F17BD98D100BC12DD /* UIKit.framework in Frameworks */, 53 | 65EF11A117BD98D100BC12DD /* Foundation.framework in Frameworks */, 54 | 65EF11A317BD98D100BC12DD /* CoreGraphics.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | 65EF119217BD98D100BC12DD = { 62 | isa = PBXGroup; 63 | children = ( 64 | 65EF11A417BD98D100BC12DD /* GBPathImage (Example Project) */, 65 | 65EF119D17BD98D100BC12DD /* Frameworks */, 66 | 65EF119C17BD98D100BC12DD /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | 65EF119C17BD98D100BC12DD /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 65EF119B17BD98D100BC12DD /* GBPathImage.app */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | 65EF119D17BD98D100BC12DD /* Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 65EF119E17BD98D100BC12DD /* UIKit.framework */, 82 | 65EF11A017BD98D100BC12DD /* Foundation.framework */, 83 | 65EF11A217BD98D100BC12DD /* CoreGraphics.framework */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | 65EF11A417BD98D100BC12DD /* GBPathImage (Example Project) */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 65EF11C317BD990800BC12DD /* GBPathImageView */, 92 | 65EF11AD17BD98D100BC12DD /* AppDelegate.h */, 93 | 65EF11AE17BD98D100BC12DD /* AppDelegate.m */, 94 | 65EF11B617BD98D100BC12DD /* ViewController.h */, 95 | 65EF11B717BD98D100BC12DD /* ViewController.m */, 96 | 65EF11B917BD98D100BC12DD /* ViewController.xib */, 97 | 65EF11C117BD98F000BC12DD /* me.png */, 98 | 65EF11A517BD98D100BC12DD /* Supporting Files */, 99 | ); 100 | name = "GBPathImage (Example Project)"; 101 | path = GBPathImage; 102 | sourceTree = ""; 103 | }; 104 | 65EF11A517BD98D100BC12DD /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 65EF11A617BD98D100BC12DD /* GBPathImage-Info.plist */, 108 | 65EF11A717BD98D100BC12DD /* InfoPlist.strings */, 109 | 65EF11AA17BD98D100BC12DD /* main.m */, 110 | 65EF11AC17BD98D100BC12DD /* GBPathImage-Prefix.pch */, 111 | 65EF11B017BD98D100BC12DD /* Default.png */, 112 | 65EF11B217BD98D100BC12DD /* Default@2x.png */, 113 | 65EF11B417BD98D100BC12DD /* Default-568h@2x.png */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | 65EF11C317BD990800BC12DD /* GBPathImageView */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 65EF11C417BD992500BC12DD /* GBPathImageView.m */, 122 | 65EF11C517BD992500BC12DD /* GBPathImageView.h */, 123 | ); 124 | name = GBPathImageView; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 65EF119A17BD98D100BC12DD /* GBPathImage */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 65EF11BE17BD98D100BC12DD /* Build configuration list for PBXNativeTarget "GBPathImage" */; 133 | buildPhases = ( 134 | 65EF119717BD98D100BC12DD /* Sources */, 135 | 65EF119817BD98D100BC12DD /* Frameworks */, 136 | 65EF119917BD98D100BC12DD /* Resources */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | ); 142 | name = GBPathImage; 143 | productName = GBPathImage; 144 | productReference = 65EF119B17BD98D100BC12DD /* GBPathImage.app */; 145 | productType = "com.apple.product-type.application"; 146 | }; 147 | /* End PBXNativeTarget section */ 148 | 149 | /* Begin PBXProject section */ 150 | 65EF119317BD98D100BC12DD /* Project object */ = { 151 | isa = PBXProject; 152 | attributes = { 153 | LastUpgradeCheck = 0460; 154 | ORGANIZATIONNAME = "Matteo Gobbi"; 155 | }; 156 | buildConfigurationList = 65EF119617BD98D100BC12DD /* Build configuration list for PBXProject "GBPathImage" */; 157 | compatibilityVersion = "Xcode 3.2"; 158 | developmentRegion = English; 159 | hasScannedForEncodings = 0; 160 | knownRegions = ( 161 | en, 162 | ); 163 | mainGroup = 65EF119217BD98D100BC12DD; 164 | productRefGroup = 65EF119C17BD98D100BC12DD /* Products */; 165 | projectDirPath = ""; 166 | projectRoot = ""; 167 | targets = ( 168 | 65EF119A17BD98D100BC12DD /* GBPathImage */, 169 | ); 170 | }; 171 | /* End PBXProject section */ 172 | 173 | /* Begin PBXResourcesBuildPhase section */ 174 | 65EF119917BD98D100BC12DD /* Resources */ = { 175 | isa = PBXResourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 65EF11A917BD98D100BC12DD /* InfoPlist.strings in Resources */, 179 | 65EF11B117BD98D100BC12DD /* Default.png in Resources */, 180 | 65EF11B317BD98D100BC12DD /* Default@2x.png in Resources */, 181 | 65EF11B517BD98D100BC12DD /* Default-568h@2x.png in Resources */, 182 | 65EF11BB17BD98D100BC12DD /* ViewController.xib in Resources */, 183 | 65EF11C217BD98F000BC12DD /* me.png in Resources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXResourcesBuildPhase section */ 188 | 189 | /* Begin PBXSourcesBuildPhase section */ 190 | 65EF119717BD98D100BC12DD /* Sources */ = { 191 | isa = PBXSourcesBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | 65EF11AB17BD98D100BC12DD /* main.m in Sources */, 195 | 65EF11AF17BD98D100BC12DD /* AppDelegate.m in Sources */, 196 | 65EF11B817BD98D100BC12DD /* ViewController.m in Sources */, 197 | 65EF11C617BD992500BC12DD /* GBPathImageView.m in Sources */, 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | /* End PBXSourcesBuildPhase section */ 202 | 203 | /* Begin PBXVariantGroup section */ 204 | 65EF11A717BD98D100BC12DD /* InfoPlist.strings */ = { 205 | isa = PBXVariantGroup; 206 | children = ( 207 | 65EF11A817BD98D100BC12DD /* en */, 208 | ); 209 | name = InfoPlist.strings; 210 | sourceTree = ""; 211 | }; 212 | 65EF11B917BD98D100BC12DD /* ViewController.xib */ = { 213 | isa = PBXVariantGroup; 214 | children = ( 215 | 65EF11BA17BD98D100BC12DD /* en */, 216 | ); 217 | name = ViewController.xib; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXVariantGroup section */ 221 | 222 | /* Begin XCBuildConfiguration section */ 223 | 65EF11BC17BD98D100BC12DD /* Debug */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 228 | CLANG_CXX_LIBRARY = "libc++"; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_CONSTANT_CONVERSION = YES; 231 | CLANG_WARN_EMPTY_BODY = YES; 232 | CLANG_WARN_ENUM_CONVERSION = YES; 233 | CLANG_WARN_INT_CONVERSION = YES; 234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 235 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 236 | COPY_PHASE_STRIP = NO; 237 | GCC_C_LANGUAGE_STANDARD = gnu99; 238 | GCC_DYNAMIC_NO_PIC = NO; 239 | GCC_OPTIMIZATION_LEVEL = 0; 240 | GCC_PREPROCESSOR_DEFINITIONS = ( 241 | "DEBUG=1", 242 | "$(inherited)", 243 | ); 244 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 246 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 249 | ONLY_ACTIVE_ARCH = YES; 250 | SDKROOT = iphoneos; 251 | }; 252 | name = Debug; 253 | }; 254 | 65EF11BD17BD98D100BC12DD /* Release */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_OBJC_ARC = YES; 261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INT_CONVERSION = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 270 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 271 | GCC_WARN_UNUSED_VARIABLE = YES; 272 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 273 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 274 | SDKROOT = iphoneos; 275 | VALIDATE_PRODUCT = YES; 276 | }; 277 | name = Release; 278 | }; 279 | 65EF11BF17BD98D100BC12DD /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 283 | GCC_PREFIX_HEADER = "GBPathImage/GBPathImage-Prefix.pch"; 284 | INFOPLIST_FILE = "GBPathImage/GBPathImage-Info.plist"; 285 | PRODUCT_NAME = "$(TARGET_NAME)"; 286 | WRAPPER_EXTENSION = app; 287 | }; 288 | name = Debug; 289 | }; 290 | 65EF11C017BD98D100BC12DD /* Release */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 294 | GCC_PREFIX_HEADER = "GBPathImage/GBPathImage-Prefix.pch"; 295 | INFOPLIST_FILE = "GBPathImage/GBPathImage-Info.plist"; 296 | PRODUCT_NAME = "$(TARGET_NAME)"; 297 | WRAPPER_EXTENSION = app; 298 | }; 299 | name = Release; 300 | }; 301 | /* End XCBuildConfiguration section */ 302 | 303 | /* Begin XCConfigurationList section */ 304 | 65EF119617BD98D100BC12DD /* Build configuration list for PBXProject "GBPathImage" */ = { 305 | isa = XCConfigurationList; 306 | buildConfigurations = ( 307 | 65EF11BC17BD98D100BC12DD /* Debug */, 308 | 65EF11BD17BD98D100BC12DD /* Release */, 309 | ); 310 | defaultConfigurationIsVisible = 0; 311 | defaultConfigurationName = Release; 312 | }; 313 | 65EF11BE17BD98D100BC12DD /* Build configuration list for PBXNativeTarget "GBPathImage" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | 65EF11BF17BD98D100BC12DD /* Debug */, 317 | 65EF11C017BD98D100BC12DD /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | }; 321 | /* End XCConfigurationList section */ 322 | }; 323 | rootObject = 65EF119317BD98D100BC12DD /* Project object */; 324 | } 325 | -------------------------------------------------------------------------------- /GBPathImageExample/GBPathImage/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C60 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBNSLayoutConstraint 15 | IBProxyObject 16 | IBUIImageView 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 274 42 | {{35, 20}, {60, 60}} 43 | 44 | 45 | 46 | _NS:9 47 | NO 48 | IBCocoaTouchFramework 49 | 50 | NSImage 51 | me.png 52 | 53 | 54 | 55 | 56 | 274 57 | {{236, 20}, {60, 60}} 58 | 59 | 60 | 61 | _NS:9 62 | 1 63 | NO 64 | IBCocoaTouchFramework 65 | 66 | 67 | 68 | 69 | 274 70 | {{196, 388}, {100, 100}} 71 | 72 | 73 | 74 | _NS:9 75 | 6 76 | NO 77 | IBCocoaTouchFramework 78 | 79 | 80 | 81 | 82 | 274 83 | {{66, 288}, {80, 80}} 84 | 85 | 86 | 87 | _NS:9 88 | 4 89 | NO 90 | IBCocoaTouchFramework 91 | 92 | 93 | 94 | 95 | 274 96 | {{206, 208}, {80, 80}} 97 | 98 | 99 | 100 | _NS:9 101 | 3 102 | NO 103 | IBCocoaTouchFramework 104 | 105 | 106 | 107 | 108 | 274 109 | {{25, 428}, {90, 90}} 110 | 111 | 112 | 113 | _NS:9 114 | 5 115 | NO 116 | IBCocoaTouchFramework 117 | 118 | 119 | 120 | {{0, 20}, {320, 548}} 121 | 122 | 123 | 124 | 125 | 3 126 | MC43NQA 127 | 128 | 2 129 | 130 | 131 | NO 132 | 10 133 | 134 | 135 | IBUIScreenMetrics 136 | 137 | YES 138 | 139 | 140 | 141 | 142 | 143 | {320, 568} 144 | {568, 320} 145 | 146 | 147 | IBCocoaTouchFramework 148 | Retina 4 Full Screen 149 | 2 150 | 151 | IBCocoaTouchFramework 152 | 153 | 154 | 155 | 156 | 157 | 158 | view 159 | 160 | 161 | 162 | 7 163 | 164 | 165 | 166 | 167 | 168 | 0 169 | 170 | 171 | 172 | 173 | 174 | -1 175 | 176 | 177 | File's Owner 178 | 179 | 180 | -2 181 | 182 | 183 | 184 | 185 | 6 186 | 187 | 188 | 189 | 190 | 4 191 | 0 192 | 193 | 4 194 | 1 195 | 196 | 60 197 | 198 | 1000 199 | 200 | 3 201 | 9 202 | 3 203 | 204 | 205 | 206 | 4 207 | 0 208 | 209 | 4 210 | 1 211 | 212 | 30 213 | 214 | 1000 215 | 216 | 3 217 | 9 218 | 3 219 | 220 | 221 | 222 | 5 223 | 0 224 | 225 | 5 226 | 1 227 | 228 | 25 229 | 230 | 1000 231 | 232 | 3 233 | 9 234 | 3 235 | 236 | 237 | 238 | 5 239 | 0 240 | 241 | 5 242 | 1 243 | 244 | 66 245 | 246 | 1000 247 | 248 | 3 249 | 9 250 | 3 251 | 252 | 253 | 254 | 4 255 | 0 256 | 257 | 4 258 | 1 259 | 260 | 180 261 | 262 | 1000 263 | 264 | 3 265 | 9 266 | 3 267 | 268 | 269 | 270 | 3 271 | 0 272 | 273 | 3 274 | 1 275 | 276 | 208 277 | 278 | 1000 279 | 280 | 3 281 | 9 282 | 3 283 | 284 | 285 | 286 | 9 287 | 0 288 | 289 | 9 290 | 1 291 | 292 | 0.0 293 | 294 | 1000 295 | 296 | 6 297 | 24 298 | 2 299 | 300 | 301 | 302 | 3 303 | 0 304 | 305 | 3 306 | 1 307 | 308 | 20 309 | 310 | 1000 311 | 312 | 8 313 | 29 314 | 3 315 | 316 | 317 | 318 | 6 319 | 0 320 | 321 | 6 322 | 1 323 | 324 | 24 325 | 326 | 1000 327 | 328 | 3 329 | 9 330 | 3 331 | 332 | 333 | 334 | 6 335 | 0 336 | 337 | 6 338 | 1 339 | 340 | 0.0 341 | 342 | 1000 343 | 344 | 6 345 | 24 346 | 2 347 | 348 | 349 | 350 | 5 351 | 0 352 | 353 | 5 354 | 1 355 | 356 | 35 357 | 358 | 1000 359 | 360 | 3 361 | 9 362 | 3 363 | 364 | 365 | 366 | 3 367 | 0 368 | 369 | 3 370 | 1 371 | 372 | 20 373 | 374 | 1000 375 | 376 | 8 377 | 29 378 | 3 379 | 380 | 381 | 382 | 4 383 | 0 384 | 385 | 4 386 | 1 387 | 388 | 0.0 389 | 390 | 1000 391 | 392 | 6 393 | 24 394 | 2 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 8 407 | 408 | 409 | 410 | 411 | 7 412 | 0 413 | 414 | 0 415 | 1 416 | 417 | 60 418 | 419 | 1000 420 | 421 | 3 422 | 9 423 | 1 424 | 425 | 426 | 427 | 8 428 | 0 429 | 430 | 0 431 | 1 432 | 433 | 60 434 | 435 | 1000 436 | 437 | 3 438 | 9 439 | 1 440 | 441 | 442 | 443 | 444 | 445 | 9 446 | 447 | 448 | 449 | 450 | 7 451 | 0 452 | 453 | 0 454 | 1 455 | 456 | 60 457 | 458 | 1000 459 | 460 | 3 461 | 9 462 | 1 463 | 464 | 465 | 466 | 467 | 468 | 10 469 | 470 | 471 | 472 | 473 | 474 | 11 475 | 476 | 477 | 478 | 479 | 7 480 | 0 481 | 482 | 0 483 | 1 484 | 485 | 80 486 | 487 | 1000 488 | 489 | 3 490 | 9 491 | 1 492 | 493 | 494 | 495 | 8 496 | 0 497 | 498 | 0 499 | 1 500 | 501 | 80 502 | 503 | 1000 504 | 505 | 3 506 | 9 507 | 1 508 | 509 | 510 | 511 | 512 | 513 | 12 514 | 515 | 516 | 517 | 518 | 8 519 | 0 520 | 521 | 0 522 | 1 523 | 524 | 80 525 | 526 | 1000 527 | 528 | 3 529 | 9 530 | 1 531 | 532 | 533 | 534 | 7 535 | 0 536 | 537 | 0 538 | 1 539 | 540 | 80 541 | 542 | 1000 543 | 544 | 3 545 | 9 546 | 1 547 | 548 | 549 | 550 | 551 | 552 | 13 553 | 554 | 555 | 556 | 557 | 7 558 | 0 559 | 560 | 0 561 | 1 562 | 563 | 90 564 | 565 | 1000 566 | 567 | 3 568 | 9 569 | 1 570 | 571 | 572 | 573 | 8 574 | 0 575 | 576 | 0 577 | 1 578 | 579 | 90 580 | 581 | 1000 582 | 583 | 3 584 | 9 585 | 1 586 | 587 | 588 | 589 | 590 | 591 | 17 592 | 593 | 594 | 595 | 596 | 18 597 | 598 | 599 | 600 | 601 | 19 602 | 603 | 604 | 605 | 606 | 20 607 | 608 | 609 | 610 | 611 | 21 612 | 613 | 614 | 615 | 616 | 22 617 | 618 | 619 | 620 | 621 | 23 622 | 623 | 624 | 625 | 626 | 24 627 | 628 | 629 | 630 | 631 | 25 632 | 633 | 634 | 635 | 636 | 31 637 | 638 | 639 | 640 | 641 | 35 642 | 643 | 644 | 645 | 646 | 36 647 | 648 | 649 | 650 | 651 | 43 652 | 653 | 654 | 655 | 656 | 45 657 | 658 | 659 | 660 | 661 | 46 662 | 663 | 664 | 665 | 666 | 48 667 | 668 | 669 | 670 | 671 | 49 672 | 673 | 674 | 675 | 676 | 50 677 | 678 | 679 | 680 | 681 | 51 682 | 683 | 684 | 685 | 686 | 52 687 | 688 | 689 | 690 | 691 | 53 692 | 693 | 694 | 695 | 696 | 54 697 | 698 | 699 | 700 | 701 | 702 | 703 | ViewController 704 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 705 | UIResponder 706 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 707 | GBPathImageView 708 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 709 | 710 | GBPathImageView 711 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 712 | 713 | 714 | 715 | 716 | 717 | GBPathImageView 718 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 719 | 720 | 721 | 722 | 723 | 724 | GBPathImageView 725 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 726 | 727 | 728 | 729 | 730 | 731 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 732 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 733 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 734 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 735 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 736 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 737 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 738 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 739 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 740 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 741 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 742 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 743 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 744 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 745 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 746 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 747 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 748 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 749 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 750 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 751 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 752 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 753 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | GBPathImageView 770 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 771 | 772 | 773 | 774 | 775 | 776 | GBPathImageView 777 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 58 788 | 789 | 790 | 791 | 792 | GBPathImageView 793 | UIImageView 794 | 795 | IBProjectSource 796 | ./Classes/GBPathImageView.h 797 | 798 | 799 | 800 | NSLayoutConstraint 801 | NSObject 802 | 803 | IBProjectSource 804 | ./Classes/NSLayoutConstraint.h 805 | 806 | 807 | 808 | ViewController 809 | UIViewController 810 | 811 | IBProjectSource 812 | ./Classes/ViewController.h 813 | 814 | 815 | 816 | 817 | 0 818 | IBCocoaTouchFramework 819 | YES 820 | 3 821 | 822 | me.png 823 | {100, 100} 824 | 825 | YES 826 | 2083 827 | 828 | 829 | --------------------------------------------------------------------------------