├── Classes ├── AppDelegate.h ├── AppDelegate.m ├── ImageCropper │ ├── ImageCropper.h │ └── ImageCropper.m ├── ViewController.h └── ViewController.m ├── ImageCropper-Info.plist ├── ImageCropper.xcodeproj └── project.pbxproj ├── ImageCropper_Prefix.pch ├── Resources ├── MainWindow.xib └── SteveJobsMacbookAir.JPG └── main.m /Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | 8 | @class ViewController; 9 | 10 | @interface AppDelegate : NSObject { 11 | UIWindow *window; 12 | ViewController *viewController; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | @property (nonatomic, retain) IBOutlet ViewController *viewController; 17 | 18 | @end -------------------------------------------------------------------------------- /Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import "AppDelegate.h" 7 | #import "ViewController.h" 8 | 9 | @implementation AppDelegate 10 | 11 | @synthesize window, viewController; 12 | 13 | #pragma mark - 14 | #pragma mark Application lifecycle 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 17 | // Override point for customization after application launch. 18 | 19 | // Set the view controller as the window's root view controller and display. 20 | self.window.rootViewController = self.viewController; 21 | [self.window makeKeyAndVisible]; 22 | 23 | return YES; 24 | } 25 | 26 | #pragma mark - 27 | #pragma mark Memory management 28 | 29 | - (void)dealloc { 30 | [viewController release]; 31 | [window release]; 32 | 33 | [super dealloc]; 34 | } 35 | 36 | @end -------------------------------------------------------------------------------- /Classes/ImageCropper/ImageCropper.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageCropper.h 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | 8 | @protocol ImageCropperDelegate; 9 | 10 | @interface ImageCropper : UIViewController { 11 | UIScrollView *scrollView; 12 | UIImageView *imageView; 13 | 14 | id delegate; 15 | } 16 | 17 | @property (nonatomic, retain) UIScrollView *scrollView; 18 | @property (nonatomic, retain) UIImageView *imageView; 19 | 20 | @property (nonatomic, assign) id delegate; 21 | 22 | - (id)initWithImage:(UIImage *)image; 23 | 24 | @end 25 | 26 | @protocol ImageCropperDelegate 27 | - (void)imageCropper:(ImageCropper *)cropper didFinishCroppingWithImage:(UIImage *)image; 28 | - (void)imageCropperDidCancel:(ImageCropper *)cropper; 29 | @end -------------------------------------------------------------------------------- /Classes/ImageCropper/ImageCropper.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageCropper.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import "ImageCropper.h" 7 | 8 | @implementation ImageCropper 9 | 10 | @synthesize scrollView, imageView; 11 | @synthesize delegate; 12 | 13 | - (id)initWithImage:(UIImage *)image { 14 | self = [super init]; 15 | 16 | if (self) { 17 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES]; 18 | 19 | scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, -20.0, 320.0, 480.0)]; 20 | [scrollView setBackgroundColor:[UIColor blackColor]]; 21 | [scrollView setDelegate:self]; 22 | [scrollView setShowsHorizontalScrollIndicator:NO]; 23 | [scrollView setShowsVerticalScrollIndicator:NO]; 24 | [scrollView setMaximumZoomScale:2.0]; 25 | 26 | imageView = [[UIImageView alloc] initWithImage:image]; 27 | 28 | CGRect rect; 29 | rect.size.width = image.size.width; 30 | rect.size.height = image.size.height; 31 | 32 | [imageView setFrame:rect]; 33 | 34 | [scrollView setContentSize:[imageView frame].size]; 35 | [scrollView setMinimumZoomScale:[scrollView frame].size.width / [imageView frame].size.width]; 36 | [scrollView setZoomScale:[scrollView minimumZoomScale]]; 37 | [scrollView addSubview:imageView]; 38 | 39 | [[self view] addSubview:scrollView]; 40 | 41 | UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)]; 42 | [navigationBar setBarStyle:UIBarStyleBlack]; 43 | [navigationBar setTranslucent:YES]; 44 | 45 | UINavigationItem *aNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Move and Scale"]; 46 | [aNavigationItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelCropping)] autorelease]]; 47 | [aNavigationItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(finishCropping)] autorelease]]; 48 | 49 | [navigationBar setItems:[NSArray arrayWithObject:aNavigationItem]]; 50 | 51 | [aNavigationItem release]; 52 | 53 | [[self view] addSubview:navigationBar]; 54 | 55 | [navigationBar release]; 56 | } 57 | 58 | return self; 59 | } 60 | 61 | - (void)cancelCropping { 62 | [delegate imageCropperDidCancel:self]; 63 | } 64 | 65 | - (void)finishCropping { 66 | float zoomScale = 1.0 / [scrollView zoomScale]; 67 | 68 | CGRect rect; 69 | rect.origin.x = [scrollView contentOffset].x * zoomScale; 70 | rect.origin.y = [scrollView contentOffset].y * zoomScale; 71 | rect.size.width = [scrollView bounds].size.width * zoomScale; 72 | rect.size.height = [scrollView bounds].size.height * zoomScale; 73 | 74 | CGImageRef cr = CGImageCreateWithImageInRect([[imageView image] CGImage], rect); 75 | 76 | UIImage *cropped = [UIImage imageWithCGImage:cr]; 77 | 78 | CGImageRelease(cr); 79 | 80 | [delegate imageCropper:self didFinishCroppingWithImage:cropped]; 81 | } 82 | 83 | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { 84 | return imageView; 85 | } 86 | 87 | - (void)dealloc { 88 | [imageView release]; 89 | [scrollView release]; 90 | 91 | [super dealloc]; 92 | } 93 | 94 | @end -------------------------------------------------------------------------------- /Classes/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | #import "ImageCropper.h" 8 | 9 | @interface ViewController : UIViewController { 10 | UIImageView *imageView; 11 | } 12 | 13 | @property (nonatomic, retain) UIImageView *imageView; 14 | 15 | @end -------------------------------------------------------------------------------- /Classes/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import "ViewController.h" 7 | 8 | @implementation ViewController 9 | 10 | @synthesize imageView; 11 | 12 | - (void)loadView { 13 | [super loadView]; 14 | 15 | imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SteveJobsMacbookAir.JPG"]]; 16 | [imageView setFrame:CGRectMake(80.0, 20.0, 160.0, 230.0)]; 17 | [imageView setContentMode:UIViewContentModeScaleAspectFit]; 18 | 19 | [[self view] addSubview:imageView]; 20 | 21 | UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 22 | [button addTarget:self action:@selector(cropImage) forControlEvents:UIControlEventTouchUpInside]; 23 | [button setFrame:CGRectMake(124.0, 258.0, 72.0, 37.0)]; 24 | [button setTitle:@"Crop!" forState:UIControlStateNormal]; 25 | 26 | [[self view] addSubview:button]; 27 | } 28 | 29 | - (void)cropImage { 30 | ImageCropper *cropper = [[ImageCropper alloc] initWithImage:[imageView image]]; 31 | [cropper setDelegate:self]; 32 | 33 | [self presentModalViewController:cropper animated:YES]; 34 | 35 | [cropper release]; 36 | } 37 | 38 | - (void)imageCropper:(ImageCropper *)cropper didFinishCroppingWithImage:(UIImage *)image { 39 | [imageView setImage:image]; 40 | 41 | [self dismissModalViewControllerAnimated:YES]; 42 | 43 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; 44 | } 45 | 46 | - (void)imageCropperDidCancel:(ImageCropper *)cropper { 47 | [self dismissModalViewControllerAnimated:YES]; 48 | 49 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES]; 50 | } 51 | 52 | - (void)dealloc { 53 | [imageView release]; 54 | 55 | [super dealloc]; 56 | } 57 | 58 | @end -------------------------------------------------------------------------------- /ImageCropper-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.github.iosdeveloper.imagecropper 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /ImageCropper.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 13 | 28D7ACF80DDB3853001CB0EB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* ViewController.m */; }; 14 | 363A688013BA1ABA00516AF0 /* ImageCropper.m in Sources */ = {isa = PBXBuildFile; fileRef = 363A687F13BA1ABA00516AF0 /* ImageCropper.m */; }; 15 | 363A699613BA339400516AF0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 363A699513BA339400516AF0 /* CoreGraphics.framework */; }; 16 | 363A699A13BA339900516AF0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 363A699913BA339900516AF0 /* Foundation.framework */; }; 17 | 363A699E13BA339D00516AF0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 363A699D13BA339D00516AF0 /* UIKit.framework */; }; 18 | 36BCC1E213BA39690021BDF7 /* SteveJobsMacbookAir.JPG in Resources */ = {isa = PBXBuildFile; fileRef = 36BCC1E113BA39690021BDF7 /* SteveJobsMacbookAir.JPG */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 1D6058910D05DD3D006BFB54 /* ImageCropper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageCropper.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 26 | 28D7ACF60DDB3853001CB0EB /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 28D7ACF70DDB3853001CB0EB /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 32CA4F630368D1EE00C91783 /* ImageCropper_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCropper_Prefix.pch; sourceTree = ""; }; 30 | 363A687E13BA1ABA00516AF0 /* ImageCropper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCropper.h; sourceTree = ""; }; 31 | 363A687F13BA1ABA00516AF0 /* ImageCropper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageCropper.m; sourceTree = ""; }; 32 | 363A699513BA339400516AF0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 33 | 363A699913BA339900516AF0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 34 | 363A699D13BA339D00516AF0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 35 | 36BCC1E113BA39690021BDF7 /* SteveJobsMacbookAir.JPG */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = SteveJobsMacbookAir.JPG; sourceTree = ""; }; 36 | 8D1107310486CEB800E47090 /* ImageCropper-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "ImageCropper-Info.plist"; path = "../ImageCropper-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | 363A699613BA339400516AF0 /* CoreGraphics.framework in Frameworks */, 45 | 363A699A13BA339900516AF0 /* Foundation.framework in Frameworks */, 46 | 363A699E13BA339D00516AF0 /* UIKit.framework in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 080E96DDFE201D6D7F000001 /* Classes */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 363A687D13BA1A9E00516AF0 /* ImageCropper */, 57 | 1D3623240D0F684500981E51 /* AppDelegate.h */, 58 | 1D3623250D0F684500981E51 /* AppDelegate.m */, 59 | 28D7ACF60DDB3853001CB0EB /* ViewController.h */, 60 | 28D7ACF70DDB3853001CB0EB /* ViewController.m */, 61 | ); 62 | path = Classes; 63 | sourceTree = ""; 64 | }; 65 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 1D6058910D05DD3D006BFB54 /* ImageCropper.app */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 080E96DDFE201D6D7F000001 /* Classes */, 77 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 78 | 29B97317FDCFA39411CA2CEA /* Resources */, 79 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 80 | 19C28FACFE9D520D11CA2CBB /* Products */, 81 | ); 82 | name = CustomTemplate; 83 | sourceTree = ""; 84 | }; 85 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 32CA4F630368D1EE00C91783 /* ImageCropper_Prefix.pch */, 89 | 29B97316FDCFA39411CA2CEA /* main.m */, 90 | ); 91 | name = "Other Sources"; 92 | sourceTree = ""; 93 | }; 94 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 8D1107310486CEB800E47090 /* ImageCropper-Info.plist */, 98 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 99 | 36BCC1E113BA39690021BDF7 /* SteveJobsMacbookAir.JPG */, 100 | ); 101 | path = Resources; 102 | sourceTree = ""; 103 | }; 104 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 363A699513BA339400516AF0 /* CoreGraphics.framework */, 108 | 363A699913BA339900516AF0 /* Foundation.framework */, 109 | 363A699D13BA339D00516AF0 /* UIKit.framework */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | 363A687D13BA1A9E00516AF0 /* ImageCropper */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 363A687E13BA1ABA00516AF0 /* ImageCropper.h */, 118 | 363A687F13BA1ABA00516AF0 /* ImageCropper.m */, 119 | ); 120 | path = ImageCropper; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | 1D6058900D05DD3D006BFB54 /* ImageCropper */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ImageCropper" */; 129 | buildPhases = ( 130 | 1D60588D0D05DD3D006BFB54 /* Resources */, 131 | 1D60588E0D05DD3D006BFB54 /* Sources */, 132 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = ImageCropper; 139 | productName = ImageCropper; 140 | productReference = 1D6058910D05DD3D006BFB54 /* ImageCropper.app */; 141 | productType = "com.apple.product-type.application"; 142 | }; 143 | /* End PBXNativeTarget section */ 144 | 145 | /* Begin PBXProject section */ 146 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 147 | isa = PBXProject; 148 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ImageCropper" */; 149 | compatibilityVersion = "Xcode 3.2"; 150 | developmentRegion = English; 151 | hasScannedForEncodings = 1; 152 | knownRegions = ( 153 | English, 154 | Japanese, 155 | French, 156 | German, 157 | ); 158 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 159 | projectDirPath = ""; 160 | projectRoot = ""; 161 | targets = ( 162 | 1D6058900D05DD3D006BFB54 /* ImageCropper */, 163 | ); 164 | }; 165 | /* End PBXProject section */ 166 | 167 | /* Begin PBXResourcesBuildPhase section */ 168 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 169 | isa = PBXResourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 173 | 36BCC1E213BA39690021BDF7 /* SteveJobsMacbookAir.JPG in Resources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXResourcesBuildPhase section */ 178 | 179 | /* Begin PBXSourcesBuildPhase section */ 180 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 181 | isa = PBXSourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 185 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, 186 | 28D7ACF80DDB3853001CB0EB /* ViewController.m in Sources */, 187 | 363A688013BA1ABA00516AF0 /* ImageCropper.m in Sources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXSourcesBuildPhase section */ 192 | 193 | /* Begin XCBuildConfiguration section */ 194 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 195 | isa = XCBuildConfiguration; 196 | buildSettings = { 197 | ALWAYS_SEARCH_USER_PATHS = NO; 198 | COPY_PHASE_STRIP = NO; 199 | GCC_DYNAMIC_NO_PIC = NO; 200 | GCC_OPTIMIZATION_LEVEL = 0; 201 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 202 | GCC_PREFIX_HEADER = ImageCropper_Prefix.pch; 203 | INFOPLIST_FILE = "ImageCropper-Info.plist"; 204 | PRODUCT_NAME = ImageCropper; 205 | }; 206 | name = Debug; 207 | }; 208 | 1D6058950D05DD3E006BFB54 /* Release */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | COPY_PHASE_STRIP = YES; 213 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 214 | GCC_PREFIX_HEADER = ImageCropper_Prefix.pch; 215 | INFOPLIST_FILE = "ImageCropper-Info.plist"; 216 | PRODUCT_NAME = ImageCropper; 217 | VALIDATE_PRODUCT = YES; 218 | }; 219 | name = Release; 220 | }; 221 | C01FCF4F08A954540054247B /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 225 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 226 | GCC_C_LANGUAGE_STANDARD = c99; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 228 | GCC_WARN_UNUSED_VARIABLE = YES; 229 | PREBINDING = NO; 230 | SDKROOT = iphoneos; 231 | }; 232 | name = Debug; 233 | }; 234 | C01FCF5008A954540054247B /* Release */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 238 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 239 | GCC_C_LANGUAGE_STANDARD = c99; 240 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 243 | PREBINDING = NO; 244 | SDKROOT = iphoneos; 245 | }; 246 | name = Release; 247 | }; 248 | /* End XCBuildConfiguration section */ 249 | 250 | /* Begin XCConfigurationList section */ 251 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ImageCropper" */ = { 252 | isa = XCConfigurationList; 253 | buildConfigurations = ( 254 | 1D6058940D05DD3E006BFB54 /* Debug */, 255 | 1D6058950D05DD3E006BFB54 /* Release */, 256 | ); 257 | defaultConfigurationIsVisible = 0; 258 | defaultConfigurationName = Release; 259 | }; 260 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ImageCropper" */ = { 261 | isa = XCConfigurationList; 262 | buildConfigurations = ( 263 | C01FCF4F08A954540054247B /* Debug */, 264 | C01FCF5008A954540054247B /* Release */, 265 | ); 266 | defaultConfigurationIsVisible = 0; 267 | defaultConfigurationName = Release; 268 | }; 269 | /* End XCConfigurationList section */ 270 | }; 271 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 272 | } 273 | -------------------------------------------------------------------------------- /ImageCropper_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ImageCropper' target in the 'ImageCropper' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif -------------------------------------------------------------------------------- /Resources/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10K540 6 | 851 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | NO 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | ViewController 152 | {{329, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | AppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | AppDelegate 183 | NSObject 184 | 185 | YES 186 | 187 | YES 188 | viewController 189 | window 190 | 191 | 192 | YES 193 | ViewController 194 | UIWindow 195 | 196 | 197 | 198 | YES 199 | 200 | YES 201 | viewController 202 | window 203 | 204 | 205 | YES 206 | 207 | viewController 208 | ViewController 209 | 210 | 211 | window 212 | UIWindow 213 | 214 | 215 | 216 | 217 | IBProjectSource 218 | Classes/AppDelegate.h 219 | 220 | 221 | 222 | UIWindow 223 | UIView 224 | 225 | IBUserSource 226 | 227 | 228 | 229 | 230 | ViewController 231 | UIViewController 232 | 233 | IBProjectSource 234 | Classes/ViewController.h 235 | 236 | 237 | 238 | 239 | YES 240 | 241 | NSObject 242 | 243 | IBFrameworkSource 244 | Foundation.framework/Headers/NSError.h 245 | 246 | 247 | 248 | NSObject 249 | 250 | IBFrameworkSource 251 | Foundation.framework/Headers/NSFileManager.h 252 | 253 | 254 | 255 | NSObject 256 | 257 | IBFrameworkSource 258 | Foundation.framework/Headers/NSKeyValueCoding.h 259 | 260 | 261 | 262 | NSObject 263 | 264 | IBFrameworkSource 265 | Foundation.framework/Headers/NSKeyValueObserving.h 266 | 267 | 268 | 269 | NSObject 270 | 271 | IBFrameworkSource 272 | Foundation.framework/Headers/NSKeyedArchiver.h 273 | 274 | 275 | 276 | NSObject 277 | 278 | IBFrameworkSource 279 | Foundation.framework/Headers/NSObject.h 280 | 281 | 282 | 283 | NSObject 284 | 285 | IBFrameworkSource 286 | Foundation.framework/Headers/NSRunLoop.h 287 | 288 | 289 | 290 | NSObject 291 | 292 | IBFrameworkSource 293 | Foundation.framework/Headers/NSThread.h 294 | 295 | 296 | 297 | NSObject 298 | 299 | IBFrameworkSource 300 | Foundation.framework/Headers/NSURL.h 301 | 302 | 303 | 304 | NSObject 305 | 306 | IBFrameworkSource 307 | Foundation.framework/Headers/NSURLConnection.h 308 | 309 | 310 | 311 | NSObject 312 | 313 | IBFrameworkSource 314 | UIKit.framework/Headers/UIAccessibility.h 315 | 316 | 317 | 318 | NSObject 319 | 320 | IBFrameworkSource 321 | UIKit.framework/Headers/UINibLoading.h 322 | 323 | 324 | 325 | NSObject 326 | 327 | IBFrameworkSource 328 | UIKit.framework/Headers/UIResponder.h 329 | 330 | 331 | 332 | UIApplication 333 | UIResponder 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIApplication.h 337 | 338 | 339 | 340 | UIResponder 341 | NSObject 342 | 343 | 344 | 345 | UISearchBar 346 | UIView 347 | 348 | IBFrameworkSource 349 | UIKit.framework/Headers/UISearchBar.h 350 | 351 | 352 | 353 | UISearchDisplayController 354 | NSObject 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchDisplayController.h 358 | 359 | 360 | 361 | UIView 362 | 363 | IBFrameworkSource 364 | UIKit.framework/Headers/UIPrintFormatter.h 365 | 366 | 367 | 368 | UIView 369 | 370 | IBFrameworkSource 371 | UIKit.framework/Headers/UITextField.h 372 | 373 | 374 | 375 | UIView 376 | UIResponder 377 | 378 | IBFrameworkSource 379 | UIKit.framework/Headers/UIView.h 380 | 381 | 382 | 383 | UIViewController 384 | 385 | IBFrameworkSource 386 | UIKit.framework/Headers/UINavigationController.h 387 | 388 | 389 | 390 | UIViewController 391 | 392 | IBFrameworkSource 393 | UIKit.framework/Headers/UIPopoverController.h 394 | 395 | 396 | 397 | UIViewController 398 | 399 | IBFrameworkSource 400 | UIKit.framework/Headers/UISplitViewController.h 401 | 402 | 403 | 404 | UIViewController 405 | 406 | IBFrameworkSource 407 | UIKit.framework/Headers/UITabBarController.h 408 | 409 | 410 | 411 | UIViewController 412 | UIResponder 413 | 414 | IBFrameworkSource 415 | UIKit.framework/Headers/UIViewController.h 416 | 417 | 418 | 419 | UIWindow 420 | UIView 421 | 422 | IBFrameworkSource 423 | UIKit.framework/Headers/UIWindow.h 424 | 425 | 426 | 427 | 428 | 0 429 | IBCocoaTouchFramework 430 | 431 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 432 | 433 | 434 | 435 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 436 | 437 | 438 | YES 439 | ImageCropper.xcodeproj 440 | 3 441 | 141 442 | 443 | 444 | -------------------------------------------------------------------------------- /Resources/SteveJobsMacbookAir.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iosdeveloper/ImageCropper/04cef9034dce07f43337160bd344b744f48b2c1e/Resources/SteveJobsMacbookAir.JPG -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | 8 | int main(int argc, char *argv[]) { 9 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 10 | int retVal = UIApplicationMain(argc, argv, nil, nil); 11 | [pool release]; 12 | return retVal; 13 | } --------------------------------------------------------------------------------