diff --git a/GKClasses/GKImageCropOverlayView.m b/GKClasses/GKImageCropOverlayView.m index a103a48..20b5a80 100644 --- a/GKClasses/GKImageCropOverlayView.m +++ b/GKClasses/GKImageCropOverlayView.m @@ -7,6 +7,7 @@ // #import "GKImageCropOverlayView.h" +#import "GKImageCropView.h" @interface GKImageCropOverlayView () @property (nonatomic, strong) UIToolbar *toolbar; @@ -40,10 +41,8 @@ - (id)initWithFrame:(CGRect)frame{ - (void)drawRect:(CGRect)rect{ - CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 54; - CGFloat width = CGRectGetWidth(self.frame); - CGFloat height = CGRectGetHeight(self.frame) - toolbarSize; + CGFloat height = CGRectGetHeight(self.frame); CGFloat heightSpan = floor(height / 2 - self.cropSize.height / 2); CGFloat widthSpan = floor(width / 2 - self.cropSize.width / 2); @@ -54,23 +53,14 @@ - (void)drawRect:(CGRect)rect{ //fill inner border [[UIColor colorWithRed:1. green:1. blue:1. alpha:0.5] set]; - UIRectFrame(CGRectMake(widthSpan - 2, heightSpan - 2, self.cropSize.width + 4, self.cropSize.height + 4)); +// UIRectFrame(CGRectMake(widthSpan - 2, heightSpan - 2, self.cropSize.width + 4, self.cropSize.height + 4)); + UIRectFrame(CGRectMake(widthSpan, heightSpan, self.cropSize.width, self.cropSize.height)); //fill inner rect [[UIColor clearColor] set]; - UIRectFill(CGRectMake(widthSpan, heightSpan, self.cropSize.width, self.cropSize.height)); - +// UIRectFill(CGRectMake(widthSpan + 2, heightSpan + 2, self.cropSize.width - 4, self.cropSize.height - 4)); + UIRectFill(CGRectMake(widthSpan + 1, heightSpan + 1, self.cropSize.width - 2, self.cropSize.height - 2)); - - if (heightSpan > 30 && (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)) { - - [[UIColor whiteColor] set]; - [NSLocalizedString(@"GKImoveAndScale", @"") drawInRect:CGRectMake(10, (height - heightSpan) + (heightSpan / 2 - 20 / 2) , width - 20, 20) - withFont:[UIFont boldSystemFontOfSize:20] - lineBreakMode:NSLineBreakByTruncatingTail - alignment:NSTextAlignmentCenter]; - - } } @end diff --git a/GKClasses/GKImageCropView.h b/GKClasses/GKImageCropView.h index 2ace14b..6621212 100644 --- a/GKClasses/GKImageCropView.h +++ b/GKClasses/GKImageCropView.h @@ -8,6 +8,9 @@ #import +#define TOOLBAR_HEIGHT 72.f +#define TOOLBAR_PADDING 10.f + @interface GKImageCropView : UIView @property (nonatomic, strong) UIImage *imageToCrop; diff --git a/GKClasses/GKImageCropView.m b/GKClasses/GKImageCropView.m index f0e1d01..9093adf 100644 --- a/GKClasses/GKImageCropView.m +++ b/GKClasses/GKImageCropView.m @@ -45,6 +45,7 @@ - (void)layoutSubviews{ frameToCenter.origin.y = 0; zoomView.frame = frameToCenter; +// zoomView.frame = CGRectMake(0, 0, 200, 200); } @end @@ -131,15 +132,8 @@ -(CGRect)_calcVisibleRectForCropArea{ CGFloat scaleHeight = self.imageToCrop.size.height / self.cropSize.height; CGFloat scale = 0.0f; - if (self.cropSize.width > self.cropSize.height) { - scale = (self.imageToCrop.size.width < self.imageToCrop.size.height ? - MAX(scaleWidth, scaleHeight) : - MIN(scaleWidth, scaleHeight)); - }else{ - scale = (self.imageToCrop.size.width < self.imageToCrop.size.height ? - MIN(scaleWidth, scaleHeight) : - MAX(scaleWidth, scaleHeight)); - } + scale = MIN(scaleWidth, scaleHeight); + //extract visible rect from scrollview and scale it CGRect visibleRect = [scrollView convertRect:scrollView.bounds toView:imageView]; return visibleRect = GKScaleRect(visibleRect, scale); @@ -229,34 +223,34 @@ - (void)layoutSubviews{ [super layoutSubviews]; CGSize size = self.cropSize; - CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 54; self.xOffset = floor((CGRectGetWidth(self.bounds) - size.width) * 0.5); - self.yOffset = floor((CGRectGetHeight(self.bounds) - toolbarSize - size.height) * 0.5); //fixed + self.yOffset = floor((CGRectGetHeight(self.bounds) - size.height) * 0.5); //fixed CGFloat height = self.imageToCrop.size.height; CGFloat width = self.imageToCrop.size.width; - CGFloat faktor = 0.f; - CGFloat faktoredHeight = 0.f; - CGFloat faktoredWidth = 0.f; + CGFloat factor = 0.f, widthFactor = 0.f, heightFactor = 0.f; + CGFloat factoredHeight = 0.f; + CGFloat factoredWidth = 0.f; - if(width > height){ - - faktor = width / size.width; - faktoredWidth = size.width; - faktoredHeight = height / faktor; - - } else { - - faktor = height / size.height; - faktoredWidth = width / faktor; - faktoredHeight = size.height; - } + widthFactor = width / size.width; + heightFactor = height / size.height; + factor = MIN(widthFactor, heightFactor); + factoredWidth = width / factor; + factoredHeight = height / factor; self.cropOverlayView.frame = self.bounds; self.scrollView.frame = CGRectMake(xOffset, yOffset, size.width, size.height); self.scrollView.contentSize = CGSizeMake(size.width, size.height); - self.imageView.frame = CGRectMake(0, floor((size.height - faktoredHeight) * 0.5), faktoredWidth, faktoredHeight); + self.imageView.frame = CGRectMake(0, floor((size.height - factoredHeight) * 0.5), factoredWidth, factoredHeight); + + /* TODO + implement a feature that allows restricting the zoom scale to the max available + (based on image's resolution), to prevent pixelation. We simply have to deteremine the + max zoom scale and place it here + */ + [self.scrollView setContentOffset:CGPointMake((factoredWidth - size.width) * 0.5, (factoredHeight - size.height) * 0.5)]; + [self.scrollView setZoomScale:1.0]; } #pragma mark - diff --git a/GKClasses/GKImageCropViewController.m b/GKClasses/GKImageCropViewController.m index 64f4bfc..cb1153b 100644 --- a/GKClasses/GKImageCropViewController.m +++ b/GKClasses/GKImageCropViewController.m @@ -9,10 +9,12 @@ #import "GKImageCropViewController.h" #import "GKImageCropView.h" +#define HORIZONTAL_TEXT_PADDING 13.f + @interface GKImageCropViewController () @property (nonatomic, strong) GKImageCropView *imageCropView; -@property (nonatomic, strong) UIToolbar *toolbar; +@property (nonatomic, strong) UIView *toolbarView; @property (nonatomic, strong) UIButton *cancelButton; @property (nonatomic, strong) UIButton *useButton; @@ -30,7 +32,7 @@ @implementation GKImageCropViewController @synthesize sourceImage, cropSize, delegate; @synthesize imageCropView; -@synthesize toolbar; +@synthesize toolbarView; @synthesize cancelButton, useButton, resizeableCropArea; #pragma mark - @@ -49,111 +51,118 @@ - (void)_actionUse{ - (void)_setupNavigationBar{ - - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(_actionCancel)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"GKIuse", @"") + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Use", @"Use") style:UIBarButtonItemStyleBordered target:self action:@selector(_actionUse)]; } +#pragma mark - +#pragma mark - Crop Rect Normalizing + +- (CGSize)normalizedCropSizeForRect:(CGRect)rect +{ + CGSize normalizedSize; + CGSize maxSize = CGSizeMake(rect.size.width - (2 * TOOLBAR_PADDING), + rect.size.height - (2. * (TOOLBAR_HEIGHT + TOOLBAR_PADDING))); + if (self.cropSize.height / self.cropSize.width > maxSize.height / maxSize.width) { + normalizedSize = CGSizeMake(self.cropSize.width * maxSize.height / self.cropSize.height, + maxSize.height); + } else { + normalizedSize = CGSizeMake(maxSize.width, + self.cropSize.height * maxSize.width / self.cropSize.width); + } + return normalizedSize; +} + - (void)_setupCropView{ self.imageCropView = [[GKImageCropView alloc] initWithFrame:self.view.bounds]; [self.imageCropView setImageToCrop:sourceImage]; [self.imageCropView setResizableCropArea:self.resizeableCropArea]; - [self.imageCropView setCropSize:cropSize]; + [self.imageCropView setCropSize:[self normalizedCropSizeForRect:self.view.bounds]]; + self.imageCropView.clipsToBounds = YES; [self.view addSubview:self.imageCropView]; } +- (CGSize)sizeForString:(NSString *)string withFont:(UIFont *)font{ + NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; + attributes[NSFontAttributeName] = font; + + CGSize constrainedSize = CGSizeMake(self.view.frame.size.width, TOOLBAR_HEIGHT); + CGSize neededSize = CGSizeMake(0, 0); + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + neededSize = [string boundingRectWithSize:constrainedSize + options:NSStringDrawingUsesLineFragmentOrigin + attributes:attributes + context:nil].size; +#else + neededSize = [string sizeWithFont:font + constrainedToSize:constrainedSize + lineBreakMode:NSLineBreakByTruncatingMiddle]; +#endif + return CGSizeMake(neededSize.width, TOOLBAR_HEIGHT); +} + +- (UIFont *)buttonFont +{ + return [UIFont systemFontOfSize:18.f]; +} + - (void)_setupCancelButton{ + CGSize buttonSize = [self sizeForString:NSLocalizedString(@"Cancel", @"Cancel") + withFont:[self buttonFont]]; self.cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; - - [self.cancelButton setBackgroundImage:[[UIImage imageNamed:@"PLCameraSheetButton.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateNormal]; - [self.cancelButton setBackgroundImage:[[UIImage imageNamed:@"PLCameraSheetButtonPressed.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateHighlighted]; - - [[self.cancelButton titleLabel] setFont:[UIFont boldSystemFontOfSize:11]]; - [[self.cancelButton titleLabel] setShadowOffset:CGSizeMake(0, 1)]; - [self.cancelButton setFrame:CGRectMake(0, 0, 50, 30)]; - [self.cancelButton setTitle:NSLocalizedString(@"GKIcancel",@"") forState:UIControlStateNormal]; - [self.cancelButton setTitleColor:[UIColor colorWithRed:0.173 green:0.176 blue:0.176 alpha:1] forState:UIControlStateNormal]; - [self.cancelButton setTitleShadowColor:[UIColor colorWithRed:0.827 green:0.831 blue:0.839 alpha:1] forState:UIControlStateNormal]; + [[self.cancelButton titleLabel] setFont:[self buttonFont]]; + [self.cancelButton setFrame:CGRectMake(HORIZONTAL_TEXT_PADDING, 0, buttonSize.width, buttonSize.height)]; + [self.cancelButton setTitle:NSLocalizedString(@"Cancel", @"Cancel") forState:UIControlStateNormal]; + [self.cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.cancelButton addTarget:self action:@selector(_actionCancel) forControlEvents:UIControlEventTouchUpInside]; - } - (void)_setupUseButton{ + CGSize buttonSize = [self sizeForString:NSLocalizedString(@"Use",@"Use") + withFont:[self buttonFont]]; self.useButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [self.useButton setBackgroundImage:[[UIImage imageNamed:@"PLCameraSheetDoneButton.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateNormal]; - [self.useButton setBackgroundImage:[[UIImage imageNamed:@"PLCameraSheetDoneButtonPressed.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forState:UIControlStateHighlighted]; - - [[self.useButton titleLabel] setFont:[UIFont boldSystemFontOfSize:11]]; - [[self.useButton titleLabel] setShadowOffset:CGSizeMake(0, -1)]; - [self.useButton setFrame:CGRectMake(0, 0, 50, 30)]; - [self.useButton setTitle:NSLocalizedString(@"GKIuse",@"") forState:UIControlStateNormal]; - [self.useButton setTitleShadowColor:[UIColor colorWithRed:0.118 green:0.247 blue:0.455 alpha:1] forState:UIControlStateNormal]; + [[self.useButton titleLabel] setFont:[self buttonFont]]; + [self.useButton setFrame:CGRectMake(self.view.frame.size.width - (buttonSize.width + HORIZONTAL_TEXT_PADDING), 0, buttonSize.width, buttonSize.height)]; + [self.useButton setTitle:NSLocalizedString(@"Use",@"Use") forState:UIControlStateNormal]; + [self.useButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.useButton addTarget:self action:@selector(_actionUse) forControlEvents:UIControlEventTouchUpInside]; - } -- (UIImage *)_toolbarBackgroundImage{ - - CGFloat components[] = { - 1., 1., 1., 1., - 123./255., 125/255., 132./255., 1. - }; - - UIGraphicsBeginImageContextWithOptions(CGSizeMake(320, 54), YES, 0.0); - - CGContextRef ctx = UIGraphicsGetCurrentContext(); - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, components, NULL, 2); - - CGContextDrawLinearGradient(ctx, gradient, CGPointMake(0, 0), CGPointMake(0, 54), kCGImageAlphaNoneSkipFirst); - - UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); - - CGGradientRelease(gradient); - CGColorSpaceRelease(colorSpace); - UIGraphicsEndImageContext(); - - return viewImage; -} - (void)_setupToolbar{ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { - self.toolbar = [[UIToolbar alloc] initWithFrame:CGRectZero]; - [self.toolbar setBackgroundImage:[self _toolbarBackgroundImage] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault]; - [self.view addSubview:self.toolbar]; + self.toolbarView = [[UIView alloc] initWithFrame:CGRectMake(0, + self.view.frame.size.height - TOOLBAR_HEIGHT, + self.view.frame.size.width, + TOOLBAR_HEIGHT)]; + self.toolbarView.backgroundColor = [UIColor colorWithRed:20./255. green:20./255. blue:20./255. alpha:0.65]; + [self.view addSubview:self.toolbarView]; [self _setupCancelButton]; [self _setupUseButton]; - UILabel *info = [[UILabel alloc] initWithFrame:CGRectZero]; - info.text = NSLocalizedString(@"GKImoveAndScale", @""); - info.textColor = [UIColor colorWithRed:0.173 green:0.173 blue:0.173 alpha:1]; - info.backgroundColor = [UIColor clearColor]; - info.shadowColor = [UIColor colorWithRed:0.827 green:0.831 blue:0.839 alpha:1]; - info.shadowOffset = CGSizeMake(0, 1); - info.font = [UIFont boldSystemFontOfSize:18]; - [info sizeToFit]; - - UIBarButtonItem *cancel = [[UIBarButtonItem alloc] initWithCustomView:self.cancelButton]; - UIBarButtonItem *flex = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; - UIBarButtonItem *lbl = [[UIBarButtonItem alloc] initWithCustomView:info]; - UIBarButtonItem *use = [[UIBarButtonItem alloc] initWithCustomView:self.useButton]; - - [self.toolbar setItems:[NSArray arrayWithObjects:cancel, flex, lbl, flex, use, nil]]; + [self.toolbarView addSubview:self.cancelButton]; + [self.toolbarView addSubview:self.useButton]; } } +- (BOOL)prefersStatusBarHidden { + return YES; +} + #pragma mark - #pragma Super Class Methods @@ -169,7 +178,8 @@ - (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. - self.title = NSLocalizedString(@"GKIchoosePhoto", @""); + self.title = NSLocalizedString(@"Choose Photo", @"Choose Photo"); + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; [self _setupNavigationBar]; [self _setupCropView]; @@ -187,11 +197,17 @@ - (void)viewDidUnload{ // Release any retained subviews of the main view. } +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; +} + - (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; self.imageCropView.frame = self.view.bounds; - self.toolbar.frame = CGRectMake(0, CGRectGetHeight(self.view.frame) - 54, 320, 54); + self.toolbarView.frame = CGRectMake(0, CGRectGetHeight(self.view.frame) - TOOLBAR_HEIGHT, self.view.frame.size.width, TOOLBAR_HEIGHT); } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation diff --git a/GKClasses/GKImagePicker.h b/GKClasses/GKImagePicker.h index a8fa789..2497bd1 100644 --- a/GKClasses/GKImagePicker.h +++ b/GKClasses/GKImagePicker.h @@ -14,9 +14,10 @@ @property (nonatomic, weak) id delegate; @property (nonatomic, assign) CGSize cropSize; //default value is 320x320 (which is exactly the same as the normal imagepicker uses) -@property (nonatomic, strong, readonly) UIImagePickerController *imagePickerController; @property (nonatomic, assign) BOOL resizeableCropArea; +- (void)showActionSheetOnViewController:(UIViewController *)viewController onPopoverFromView:(UIView *)popoverView; + @end diff --git a/GKClasses/GKImagePicker.m b/GKClasses/GKImagePicker.m index 5793f49..d55a669 100644 --- a/GKClasses/GKImagePicker.m +++ b/GKClasses/GKImagePicker.m @@ -7,10 +7,14 @@ // #import "GKImagePicker.h" + #import "GKImageCropViewController.h" -@interface GKImagePicker () -@property (nonatomic, strong, readwrite) UIImagePickerController *imagePickerController; +@interface GKImagePicker () +@property (nonatomic, weak) UIViewController *presentingViewController; +@property (nonatomic, weak) UIView *popoverView; +@property (nonatomic, strong) UIPopoverController *popoverController; +@property (nonatomic, strong) UIImagePickerController *imagePickerController; - (void)_hideController; @end @@ -20,8 +24,6 @@ @implementation GKImagePicker #pragma mark Getter/Setter @synthesize cropSize, delegate, resizeableCropArea; -@synthesize imagePickerController = _imagePickerController; - #pragma mark - #pragma mark Init Methods @@ -31,9 +33,6 @@ - (id)init{ self.cropSize = CGSizeMake(320, 320); self.resizeableCropArea = NO; - _imagePickerController = [[UIImagePickerController alloc] init]; - _imagePickerController.delegate = self; - _imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } return self; } @@ -42,13 +41,12 @@ - (id)init{ # pragma mark Private Methods - (void)_hideController{ - - if (![_imagePickerController.presentedViewController isKindOfClass:[UIPopoverController class]]){ - + if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) { + [self.popoverController dismissPopoverAnimated:YES]; + } else { [self.imagePickerController dismissViewControllerAnimated:YES completion:nil]; - - } - + } + } #pragma mark - @@ -71,7 +69,11 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ GKImageCropViewController *cropController = [[GKImageCropViewController alloc] init]; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + cropController.preferredContentSize = picker.preferredContentSize; +#else cropController.contentSizeForViewInPopover = picker.contentSizeForViewInPopover; +#endif cropController.sourceImage = [info objectForKey:UIImagePickerControllerOriginalImage]; cropController.resizeableCropArea = self.resizeableCropArea; cropController.cropSize = self.cropSize; @@ -86,7 +88,94 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking - (void)imageCropController:(GKImageCropViewController *)imageCropController didFinishWithCroppedImage:(UIImage *)croppedImage{ if ([self.delegate respondsToSelector:@selector(imagePicker:pickedImage:)]) { - [self.delegate imagePicker:self pickedImage:croppedImage]; + [self _hideController]; + [self.delegate imagePicker:self pickedImage:croppedImage]; + } +} + + +#pragma mark - +#pragma mark - Action Sheet and Image Pickers + +- (void)showActionSheetOnViewController:(UIViewController *)viewController onPopoverFromView:(UIView *)popoverView +{ + self.presentingViewController = viewController; + self.popoverView = popoverView; + + UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil + delegate:(id)self + cancelButtonTitle:NSLocalizedString(@"Cancel", @"Cancel") + destructiveButtonTitle:nil + otherButtonTitles:NSLocalizedString(@"Image from Camera", @"Image from Camera"), NSLocalizedString(@"Image from Library", @"Image from Library"), nil]; + actionSheet.delegate = self; + + if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) { + [actionSheet showFromRect:self.popoverView.frame inView:self.presentingViewController.view animated:YES]; + } else { + if (self.presentingViewController.navigationController.toolbar) { + [actionSheet showFromToolbar:self.presentingViewController.navigationController.toolbar]; + } else { + [actionSheet showInView:self.presentingViewController.view]; + } + } +} + +- (void)presentImagePickerController +{ + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + + self.popoverController = [[UIPopoverController alloc] initWithContentViewController:self.imagePickerController]; + [self.popoverController presentPopoverFromRect:self.popoverView.frame + inView:self.presentingViewController.view + permittedArrowDirections:UIPopoverArrowDirectionAny + animated:YES]; + + } else { + + [self.presentingViewController presentViewController:self.imagePickerController animated:YES completion:nil]; + + } +} + +- (void)showCameraImagePicker { + +#if TARGET_IPHONE_SIMULATOR + + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Simulator" message:@"Camera not available." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + [alert show]; + +#elif TARGET_OS_IPHONE + + self.imagePickerController = [[UIImagePickerController alloc] init]; + self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; + self.imagePickerController.delegate = self; + self.imagePickerController.allowsEditing = NO; + + [self presentImagePickerController]; +#endif + +} + +- (void)showGalleryImagePicker { + self.imagePickerController = [[UIImagePickerController alloc] init]; + self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + self.imagePickerController.delegate = self; + self.imagePickerController.allowsEditing = NO; + + [self presentImagePickerController]; +} + +#pragma mark - +#pragma mark - UIActionSheetDelegate + +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + switch (buttonIndex) { + case 0: + [self showCameraImagePicker]; + break; + case 1: + [self showGalleryImagePicker]; + break; } } diff --git a/GKClasses/GKResizeableCropOverlayView.m b/GKClasses/GKResizeableCropOverlayView.m index 97b98f6..970e4c4 100644 --- a/GKClasses/GKResizeableCropOverlayView.m +++ b/GKClasses/GKResizeableCropOverlayView.m @@ -8,6 +8,7 @@ #import "GKResizeableCropOverlayView.h" #import "GKCropBorderView.h" +#import "GKImageCropView.h" #define kBorderCorrectionValue 12 @@ -41,9 +42,8 @@ @implementation GKResizeableCropOverlayView -(void)setFrame:(CGRect)frame{ [super setFrame:frame]; - CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 54; - _contentView.frame = CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 , (self.bounds.size.height - toolbarSize) / 2 - _initialContentSize.height / 2 , _initialContentSize.width, _initialContentSize.height); - _cropBorderView.frame = CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 - kBorderCorrectionValue, (self.bounds.size.height - toolbarSize) / 2 - _initialContentSize.height / 2 - kBorderCorrectionValue, _initialContentSize.width + kBorderCorrectionValue*2, _initialContentSize.height + kBorderCorrectionValue*2); + _contentView.frame = CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 , (self.bounds.size.height) / 2 - _initialContentSize.height / 2 , _initialContentSize.width, _initialContentSize.height); + _cropBorderView.frame = CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 - kBorderCorrectionValue, (self.bounds.size.height) / 2 - _initialContentSize.height / 2 - kBorderCorrectionValue, _initialContentSize.width + kBorderCorrectionValue*2, _initialContentSize.height + kBorderCorrectionValue*2); } @@ -93,15 +93,13 @@ -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ #pragma private -(void)_addContentViews{ - CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 54; - - _contentView = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 , (self.bounds.size.height - toolbarSize) / 2 - _initialContentSize.height / 2 , _initialContentSize.width, _initialContentSize.height)]; + _contentView = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 , (self.bounds.size.height) / 2 - _initialContentSize.height / 2 , _initialContentSize.width, _initialContentSize.height)]; _contentView.backgroundColor = [UIColor clearColor]; self.cropSize = _contentView.frame.size; [self addSubview:_contentView]; // NSLog(@"x: %f y: %f %f", CGRectGetMinX(_contentView.frame), CGRectGetMinY(_contentView.frame), self.bounds.size.width); - _cropBorderView = [[GKCropBorderView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 - kBorderCorrectionValue, (self.bounds.size.height - toolbarSize) / 2 - _initialContentSize.height / 2 - kBorderCorrectionValue, _initialContentSize.width + kBorderCorrectionValue*2, _initialContentSize.height + kBorderCorrectionValue*2)]; + _cropBorderView = [[GKCropBorderView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 - _initialContentSize.width / 2 - kBorderCorrectionValue, (self.bounds.size.height) / 2 - _initialContentSize.height / 2 - kBorderCorrectionValue, _initialContentSize.width + kBorderCorrectionValue*2, _initialContentSize.height + kBorderCorrectionValue*2)]; [self addSubview:_cropBorderView]; } @@ -178,8 +176,6 @@ -(void)_resizeWithTouchPoint:(CGPoint)point{ } -(CGRect)_preventBorderFrameFromGettingTooSmallOrTooBig:(CGRect)newFrame{ - CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 54; - if (newFrame.size.width < 64) { newFrame.size.width = _cropBorderView.frame.size.width; newFrame.origin.x = _cropBorderView.frame.origin.x; @@ -202,8 +198,8 @@ -(CGRect)_preventBorderFrameFromGettingTooSmallOrTooBig:(CGRect)newFrame{ if (newFrame.size.width + newFrame.origin.x > self.frame.size.width) newFrame.size.width = self.frame.size.width - _cropBorderView.frame.origin.x; - if (newFrame.size.height + newFrame.origin.y > self.frame.size.height - toolbarSize) - newFrame.size.height = self.frame.size.height - _cropBorderView.frame.origin.y - toolbarSize; + if (newFrame.size.height + newFrame.origin.y > self.frame.size.height) + newFrame.size.height = self.frame.size.height - _cropBorderView.frame.origin.y; return newFrame; } diff --git a/GKImagePicker.xcodeproj/project.pbxproj b/GKImagePicker.xcodeproj/project.pbxproj index dcc1d0d..343e019 100644 --- a/GKImagePicker.xcodeproj/project.pbxproj +++ b/GKImagePicker.xcodeproj/project.pbxproj @@ -1,1108 +1,400 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - C147FBF51677C12F0035B373 - - isa - PBXFileReference - lastKnownFileType - image.png - path - Default-568h@2x.png - sourceTree - <group> - - C147FBF61677C12F0035B373 - - fileRef - C147FBF51677C12F0035B373 - isa - PBXBuildFile - - C1C7B6531598429E007B2669 - - children - - C1C7B6681598429E007B2669 - C1C7B6611598429E007B2669 - C1C7B65F1598429E007B2669 - - isa - PBXGroup - sourceTree - <group> - - C1C7B6551598429E007B2669 - - attributes - - LastUpgradeCheck - 0450 - ORGANIZATIONNAME - Georg Kitz - - buildConfigurationList - C1C7B6581598429E007B2669 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - C1C7B6531598429E007B2669 - productRefGroup - C1C7B65F1598429E007B2669 - projectDirPath - - projectReferences - - projectRoot - - targets - - C1C7B65D1598429E007B2669 - - - C1C7B6581598429E007B2669 - - buildConfigurations - - C1C7B67D1598429E007B2669 - C1C7B67E1598429E007B2669 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - C1C7B65A1598429E007B2669 - - buildActionMask - 2147483647 - files - - C1C7B6E515984465007B2669 - C1C7B6E615984465007B2669 - C1C7B6E715984465007B2669 - C1C7B6E815984465007B2669 - C1C7B6E41598445C007B2669 - C1C7B66F1598429E007B2669 - C1C7B6731598429E007B2669 - D696F4FA16111C28007802E6 - D6862A9216111C68005A5C5C - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - C1C7B65B1598429E007B2669 - - buildActionMask - 2147483647 - files - - C1C7B6631598429E007B2669 - C1C7B6651598429E007B2669 - C1C7B6671598429E007B2669 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - C1C7B65C1598429E007B2669 - - buildActionMask - 2147483647 - files - - C1C7B66D1598429E007B2669 - C1C7B6791598429E007B2669 - C1C7B67C1598429E007B2669 - C1C7B6D815984313007B2669 - C1C7B6D915984313007B2669 - C1C7B6DA15984313007B2669 - C1C7B6DB15984313007B2669 - C1C7B6DC15984313007B2669 - C1C7B6DD15984313007B2669 - C1C7B6DE15984313007B2669 - C1C7B6DF15984313007B2669 - C1C7B6E315984338007B2669 - C147FBF61677C12F0035B373 - - isa - PBXResourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - C1C7B65D1598429E007B2669 - - buildConfigurationList - C1C7B67F1598429E007B2669 - buildPhases - - C1C7B65A1598429E007B2669 - C1C7B65B1598429E007B2669 - C1C7B65C1598429E007B2669 - - buildRules - - dependencies - - isa - PBXNativeTarget - name - GKImagePicker - productName - GKImagePicker - productReference - C1C7B65E1598429E007B2669 - productType - com.apple.product-type.application - - C1C7B65E1598429E007B2669 - - explicitFileType - wrapper.application - includeInIndex - 0 - isa - PBXFileReference - path - GKImagePicker.app - sourceTree - BUILT_PRODUCTS_DIR - - C1C7B65F1598429E007B2669 - - children - - C1C7B65E1598429E007B2669 - - isa - PBXGroup - name - Products - sourceTree - <group> - - C1C7B6611598429E007B2669 - - children - - C1C7B6621598429E007B2669 - C1C7B6641598429E007B2669 - C1C7B6661598429E007B2669 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - C1C7B6621598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - UIKit.framework - path - System/Library/Frameworks/UIKit.framework - sourceTree - SDKROOT - - C1C7B6631598429E007B2669 - - fileRef - C1C7B6621598429E007B2669 - isa - PBXBuildFile - - C1C7B6641598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - System/Library/Frameworks/Foundation.framework - sourceTree - SDKROOT - - C1C7B6651598429E007B2669 - - fileRef - C1C7B6641598429E007B2669 - isa - PBXBuildFile - - C1C7B6661598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - CoreGraphics.framework - path - System/Library/Frameworks/CoreGraphics.framework - sourceTree - SDKROOT - - C1C7B6671598429E007B2669 - - fileRef - C1C7B6661598429E007B2669 - isa - PBXBuildFile - - C1C7B6681598429E007B2669 - - children - - C1C7B6C6159842EA007B2669 - C1C7B6711598429E007B2669 - C1C7B6721598429E007B2669 - C1C7B6E015984328007B2669 - C1C7B6E115984328007B2669 - C1C7B6771598429E007B2669 - C1C7B67A1598429E007B2669 - C1C7B6691598429E007B2669 - - isa - PBXGroup - path - GKImagePicker - sourceTree - <group> - - C1C7B6691598429E007B2669 - - children - - C147FBF51677C12F0035B373 - C1C7B66A1598429E007B2669 - C1C7B66B1598429E007B2669 - C1C7B66E1598429E007B2669 - C1C7B6701598429E007B2669 - C1C7B6E215984338007B2669 - - isa - PBXGroup - name - Supporting Files - sourceTree - <group> - - C1C7B66A1598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - GKImagePicker-Info.plist - sourceTree - <group> - - C1C7B66B1598429E007B2669 - - children - - C1C7B66C1598429E007B2669 - - isa - PBXVariantGroup - name - InfoPlist.strings - sourceTree - <group> - - C1C7B66C1598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - text.plist.strings - name - en - path - en.lproj/InfoPlist.strings - sourceTree - <group> - - C1C7B66D1598429E007B2669 - - fileRef - C1C7B66B1598429E007B2669 - isa - PBXBuildFile - - C1C7B66E1598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - main.m - sourceTree - <group> - - C1C7B66F1598429E007B2669 - - fileRef - C1C7B66E1598429E007B2669 - isa - PBXBuildFile - - C1C7B6701598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - GKImagePicker-Prefix.pch - sourceTree - <group> - - C1C7B6711598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - AppDelegate.h - sourceTree - <group> - - C1C7B6721598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - AppDelegate.m - sourceTree - <group> - - C1C7B6731598429E007B2669 - - fileRef - C1C7B6721598429E007B2669 - isa - PBXBuildFile - - C1C7B6771598429E007B2669 - - children - - C1C7B6781598429E007B2669 - - isa - PBXVariantGroup - name - ViewController_iPhone.xib - sourceTree - <group> - - C1C7B6781598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - file.xib - name - en - path - en.lproj/ViewController_iPhone.xib - sourceTree - <group> - - C1C7B6791598429E007B2669 - - fileRef - C1C7B6771598429E007B2669 - isa - PBXBuildFile - - C1C7B67A1598429E007B2669 - - children - - C1C7B67B1598429E007B2669 - - isa - PBXVariantGroup - name - ViewController_iPad.xib - sourceTree - <group> - - C1C7B67B1598429E007B2669 - - isa - PBXFileReference - lastKnownFileType - file.xib - name - en - path - en.lproj/ViewController_iPad.xib - sourceTree - <group> - - C1C7B67C1598429E007B2669 - - fileRef - C1C7B67A1598429E007B2669 - isa - PBXBuildFile - - C1C7B67D1598429E007B2669 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - COPY_PHASE_STRIP - NO - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - SDKROOT - iphoneos - TARGETED_DEVICE_FAMILY - 1,2 - - isa - XCBuildConfiguration - name - Debug - - C1C7B67E1598429E007B2669 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - COPY_PHASE_STRIP - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - OTHER_CFLAGS - -DNS_BLOCK_ASSERTIONS=1 - SDKROOT - iphoneos - TARGETED_DEVICE_FAMILY - 1,2 - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - C1C7B67F1598429E007B2669 - - buildConfigurations - - C1C7B6801598429E007B2669 - C1C7B6811598429E007B2669 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - C1C7B6801598429E007B2669 - - buildSettings - - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - GKImagePicker/GKImagePicker-Prefix.pch - INFOPLIST_FILE - GKImagePicker/GKImagePicker-Info.plist - IPHONEOS_DEPLOYMENT_TARGET - 5.0 - LIBRARY_SEARCH_PATHS - - $(inherited) - $(FRANK_LIBRARY_SEARCH_PATHS) - - OTHER_LDFLAGS - - $(inherited) - $(FRANK_LDFLAGS) - - PRODUCT_NAME - $(TARGET_NAME) - WRAPPER_EXTENSION - app - - isa - XCBuildConfiguration - name - Debug - - C1C7B6811598429E007B2669 - - buildSettings - - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - GKImagePicker/GKImagePicker-Prefix.pch - INFOPLIST_FILE - GKImagePicker/GKImagePicker-Info.plist - IPHONEOS_DEPLOYMENT_TARGET - 5.0 - PRODUCT_NAME - $(TARGET_NAME) - WRAPPER_EXTENSION - app - - isa - XCBuildConfiguration - name - Release - - C1C7B6C6159842EA007B2669 - - children - - C1C7B6CF15984306007B2669 - C1C7B6C7159842F9007B2669 - C1C7B6C8159842F9007B2669 - C1C7B6C9159842F9007B2669 - C1C7B6CA159842F9007B2669 - C1C7B6CB159842F9007B2669 - C1C7B6CC159842F9007B2669 - C1C7B6CD159842F9007B2669 - C1C7B6CE159842F9007B2669 - D696F4F816111C28007802E6 - D696F4F916111C28007802E6 - D6862A9016111C68005A5C5C - D6862A9116111C68005A5C5C - - isa - PBXGroup - name - Classes - sourceTree - <group> - - C1C7B6C7159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKImagePicker.h - path - ../GKClasses/GKImagePicker.h - sourceTree - <group> - - C1C7B6C8159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKImagePicker.m - path - ../GKClasses/GKImagePicker.m - sourceTree - <group> - - C1C7B6C9159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKImageCropViewController.h - path - ../GKClasses/GKImageCropViewController.h - sourceTree - <group> - - C1C7B6CA159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKImageCropViewController.m - path - ../GKClasses/GKImageCropViewController.m - sourceTree - <group> - - C1C7B6CB159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKImageCropView.h - path - ../GKClasses/GKImageCropView.h - sourceTree - <group> - - C1C7B6CC159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKImageCropView.m - path - ../GKClasses/GKImageCropView.m - sourceTree - <group> - - C1C7B6CD159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKImageCropOverlayView.h - path - ../GKClasses/GKImageCropOverlayView.h - sourceTree - <group> - - C1C7B6CE159842F9007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKImageCropOverlayView.m - path - ../GKClasses/GKImageCropOverlayView.m - sourceTree - <group> - - C1C7B6CF15984306007B2669 - - children - - C1C7B6D015984313007B2669 - C1C7B6D115984313007B2669 - C1C7B6D215984313007B2669 - C1C7B6D315984313007B2669 - C1C7B6D415984313007B2669 - C1C7B6D515984313007B2669 - C1C7B6D615984313007B2669 - C1C7B6D715984313007B2669 - - isa - PBXGroup - name - Images - sourceTree - <group> - - C1C7B6D015984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetButton@2x.png - path - ../GKImages/PLCameraSheetButton@2x.png - sourceTree - <group> - - C1C7B6D115984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetButtonPressed@2x.png - path - ../GKImages/PLCameraSheetButtonPressed@2x.png - sourceTree - <group> - - C1C7B6D215984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetDoneButton@2x.png - path - ../GKImages/PLCameraSheetDoneButton@2x.png - sourceTree - <group> - - C1C7B6D315984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetDoneButtonPressed@2x.png - path - ../GKImages/PLCameraSheetDoneButtonPressed@2x.png - sourceTree - <group> - - C1C7B6D415984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetButton.png - path - ../GKImages/PLCameraSheetButton.png - sourceTree - <group> - - C1C7B6D515984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetButtonPressed.png - path - ../GKImages/PLCameraSheetButtonPressed.png - sourceTree - <group> - - C1C7B6D615984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetDoneButton.png - path - ../GKImages/PLCameraSheetDoneButton.png - sourceTree - <group> - - C1C7B6D715984313007B2669 - - isa - PBXFileReference - lastKnownFileType - image.png - name - PLCameraSheetDoneButtonPressed.png - path - ../GKImages/PLCameraSheetDoneButtonPressed.png - sourceTree - <group> - - C1C7B6D815984313007B2669 - - fileRef - C1C7B6D015984313007B2669 - isa - PBXBuildFile - - C1C7B6D915984313007B2669 - - fileRef - C1C7B6D115984313007B2669 - isa - PBXBuildFile - - C1C7B6DA15984313007B2669 - - fileRef - C1C7B6D215984313007B2669 - isa - PBXBuildFile - - C1C7B6DB15984313007B2669 - - fileRef - C1C7B6D315984313007B2669 - isa - PBXBuildFile - - C1C7B6DC15984313007B2669 - - fileRef - C1C7B6D415984313007B2669 - isa - PBXBuildFile - - C1C7B6DD15984313007B2669 - - fileRef - C1C7B6D515984313007B2669 - isa - PBXBuildFile - - C1C7B6DE15984313007B2669 - - fileRef - C1C7B6D615984313007B2669 - isa - PBXBuildFile - - C1C7B6DF15984313007B2669 - - fileRef - C1C7B6D715984313007B2669 - isa - PBXBuildFile - - C1C7B6E015984328007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - ViewController.h - sourceTree - <group> - - C1C7B6E115984328007B2669 - - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - ViewController.m - sourceTree - <group> - - C1C7B6E215984338007B2669 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - text.plist.strings - path - Localizable.strings - sourceTree - <group> - - C1C7B6E315984338007B2669 - - fileRef - C1C7B6E215984338007B2669 - isa - PBXBuildFile - - C1C7B6E41598445C007B2669 - - fileRef - C1C7B6E115984328007B2669 - isa - PBXBuildFile - - C1C7B6E515984465007B2669 - - fileRef - C1C7B6C8159842F9007B2669 - isa - PBXBuildFile - - C1C7B6E615984465007B2669 - - fileRef - C1C7B6CA159842F9007B2669 - isa - PBXBuildFile - - C1C7B6E715984465007B2669 - - fileRef - C1C7B6CC159842F9007B2669 - isa - PBXBuildFile - - C1C7B6E815984465007B2669 - - fileRef - C1C7B6CE159842F9007B2669 - isa - PBXBuildFile - - D6862A9016111C68005A5C5C - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKResizeableCropOverlayView.h - path - GKClasses/GKResizeableCropOverlayView.h - sourceTree - SOURCE_ROOT - - D6862A9116111C68005A5C5C - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKResizeableCropOverlayView.m - path - GKClasses/GKResizeableCropOverlayView.m - sourceTree - SOURCE_ROOT - - D6862A9216111C68005A5C5C - - fileRef - D6862A9116111C68005A5C5C - isa - PBXBuildFile - - D696F4F816111C28007802E6 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - GKCropBorderView.h - path - GKClasses/GKCropBorderView.h - sourceTree - SOURCE_ROOT - - D696F4F916111C28007802E6 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - GKCropBorderView.m - path - GKClasses/GKCropBorderView.m - sourceTree - SOURCE_ROOT - - D696F4FA16111C28007802E6 - - fileRef - D696F4F916111C28007802E6 - isa - PBXBuildFile - - - rootObject - C1C7B6551598429E007B2669 - - +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C147FBF61677C12F0035B373 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C147FBF51677C12F0035B373 /* Default-568h@2x.png */; }; + C1C7B6631598429E007B2669 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1C7B6621598429E007B2669 /* UIKit.framework */; }; + C1C7B6651598429E007B2669 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1C7B6641598429E007B2669 /* Foundation.framework */; }; + C1C7B6671598429E007B2669 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1C7B6661598429E007B2669 /* CoreGraphics.framework */; }; + C1C7B66D1598429E007B2669 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B66B1598429E007B2669 /* InfoPlist.strings */; }; + C1C7B66F1598429E007B2669 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B66E1598429E007B2669 /* main.m */; }; + C1C7B6731598429E007B2669 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6721598429E007B2669 /* AppDelegate.m */; }; + C1C7B6791598429E007B2669 /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6771598429E007B2669 /* ViewController_iPhone.xib */; }; + C1C7B67C1598429E007B2669 /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B67A1598429E007B2669 /* ViewController_iPad.xib */; }; + C1C7B6D815984313007B2669 /* PLCameraSheetButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D015984313007B2669 /* PLCameraSheetButton@2x.png */; }; + C1C7B6D915984313007B2669 /* PLCameraSheetButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D115984313007B2669 /* PLCameraSheetButtonPressed@2x.png */; }; + C1C7B6DA15984313007B2669 /* PLCameraSheetDoneButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D215984313007B2669 /* PLCameraSheetDoneButton@2x.png */; }; + C1C7B6DB15984313007B2669 /* PLCameraSheetDoneButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D315984313007B2669 /* PLCameraSheetDoneButtonPressed@2x.png */; }; + C1C7B6DC15984313007B2669 /* PLCameraSheetButton.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D415984313007B2669 /* PLCameraSheetButton.png */; }; + C1C7B6DD15984313007B2669 /* PLCameraSheetButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D515984313007B2669 /* PLCameraSheetButtonPressed.png */; }; + C1C7B6DE15984313007B2669 /* PLCameraSheetDoneButton.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D615984313007B2669 /* PLCameraSheetDoneButton.png */; }; + C1C7B6DF15984313007B2669 /* PLCameraSheetDoneButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6D715984313007B2669 /* PLCameraSheetDoneButtonPressed.png */; }; + C1C7B6E315984338007B2669 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C7B6E215984338007B2669 /* Localizable.strings */; }; + C1C7B6E41598445C007B2669 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6E115984328007B2669 /* ViewController.m */; }; + C1C7B6E515984465007B2669 /* GKImagePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6C8159842F9007B2669 /* GKImagePicker.m */; }; + C1C7B6E615984465007B2669 /* GKImageCropViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6CA159842F9007B2669 /* GKImageCropViewController.m */; }; + C1C7B6E715984465007B2669 /* GKImageCropView.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6CC159842F9007B2669 /* GKImageCropView.m */; }; + C1C7B6E815984465007B2669 /* GKImageCropOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = C1C7B6CE159842F9007B2669 /* GKImageCropOverlayView.m */; }; + D6862A9216111C68005A5C5C /* GKResizeableCropOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = D6862A9116111C68005A5C5C /* GKResizeableCropOverlayView.m */; }; + D696F4FA16111C28007802E6 /* GKCropBorderView.m in Sources */ = {isa = PBXBuildFile; fileRef = D696F4F916111C28007802E6 /* GKCropBorderView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + C147FBF51677C12F0035B373 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + C1C7B65E1598429E007B2669 /* GKImagePicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GKImagePicker.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C1C7B6621598429E007B2669 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + C1C7B6641598429E007B2669 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + C1C7B6661598429E007B2669 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + C1C7B66A1598429E007B2669 /* GKImagePicker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GKImagePicker-Info.plist"; sourceTree = ""; }; + C1C7B66C1598429E007B2669 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C1C7B66E1598429E007B2669 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C1C7B6701598429E007B2669 /* GKImagePicker-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GKImagePicker-Prefix.pch"; sourceTree = ""; }; + C1C7B6711598429E007B2669 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + C1C7B6721598429E007B2669 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + C1C7B6781598429E007B2669 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = ""; }; + C1C7B67B1598429E007B2669 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPad.xib; sourceTree = ""; }; + C1C7B6C7159842F9007B2669 /* GKImagePicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GKImagePicker.h; path = ../GKClasses/GKImagePicker.h; sourceTree = ""; }; + C1C7B6C8159842F9007B2669 /* GKImagePicker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GKImagePicker.m; path = ../GKClasses/GKImagePicker.m; sourceTree = ""; }; + C1C7B6C9159842F9007B2669 /* GKImageCropViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GKImageCropViewController.h; path = ../GKClasses/GKImageCropViewController.h; sourceTree = ""; }; + C1C7B6CA159842F9007B2669 /* GKImageCropViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GKImageCropViewController.m; path = ../GKClasses/GKImageCropViewController.m; sourceTree = ""; }; + C1C7B6CB159842F9007B2669 /* GKImageCropView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GKImageCropView.h; path = ../GKClasses/GKImageCropView.h; sourceTree = ""; }; + C1C7B6CC159842F9007B2669 /* GKImageCropView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GKImageCropView.m; path = ../GKClasses/GKImageCropView.m; sourceTree = ""; }; + C1C7B6CD159842F9007B2669 /* GKImageCropOverlayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GKImageCropOverlayView.h; path = ../GKClasses/GKImageCropOverlayView.h; sourceTree = ""; }; + C1C7B6CE159842F9007B2669 /* GKImageCropOverlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GKImageCropOverlayView.m; path = ../GKClasses/GKImageCropOverlayView.m; sourceTree = ""; }; + C1C7B6D015984313007B2669 /* PLCameraSheetButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PLCameraSheetButton@2x.png"; path = "../GKImages/PLCameraSheetButton@2x.png"; sourceTree = ""; }; + C1C7B6D115984313007B2669 /* PLCameraSheetButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PLCameraSheetButtonPressed@2x.png"; path = "../GKImages/PLCameraSheetButtonPressed@2x.png"; sourceTree = ""; }; + C1C7B6D215984313007B2669 /* PLCameraSheetDoneButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PLCameraSheetDoneButton@2x.png"; path = "../GKImages/PLCameraSheetDoneButton@2x.png"; sourceTree = ""; }; + C1C7B6D315984313007B2669 /* PLCameraSheetDoneButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PLCameraSheetDoneButtonPressed@2x.png"; path = "../GKImages/PLCameraSheetDoneButtonPressed@2x.png"; sourceTree = ""; }; + C1C7B6D415984313007B2669 /* PLCameraSheetButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PLCameraSheetButton.png; path = ../GKImages/PLCameraSheetButton.png; sourceTree = ""; }; + C1C7B6D515984313007B2669 /* PLCameraSheetButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PLCameraSheetButtonPressed.png; path = ../GKImages/PLCameraSheetButtonPressed.png; sourceTree = ""; }; + C1C7B6D615984313007B2669 /* PLCameraSheetDoneButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PLCameraSheetDoneButton.png; path = ../GKImages/PLCameraSheetDoneButton.png; sourceTree = ""; }; + C1C7B6D715984313007B2669 /* PLCameraSheetDoneButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PLCameraSheetDoneButtonPressed.png; path = ../GKImages/PLCameraSheetDoneButtonPressed.png; sourceTree = ""; }; + C1C7B6E015984328007B2669 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + C1C7B6E115984328007B2669 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + C1C7B6E215984338007B2669 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; + D6862A9016111C68005A5C5C /* GKResizeableCropOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GKResizeableCropOverlayView.h; path = GKClasses/GKResizeableCropOverlayView.h; sourceTree = SOURCE_ROOT; }; + D6862A9116111C68005A5C5C /* GKResizeableCropOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GKResizeableCropOverlayView.m; path = GKClasses/GKResizeableCropOverlayView.m; sourceTree = SOURCE_ROOT; }; + D696F4F816111C28007802E6 /* GKCropBorderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GKCropBorderView.h; path = GKClasses/GKCropBorderView.h; sourceTree = SOURCE_ROOT; }; + D696F4F916111C28007802E6 /* GKCropBorderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GKCropBorderView.m; path = GKClasses/GKCropBorderView.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C1C7B65B1598429E007B2669 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C1C7B6631598429E007B2669 /* UIKit.framework in Frameworks */, + C1C7B6651598429E007B2669 /* Foundation.framework in Frameworks */, + C1C7B6671598429E007B2669 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C1C7B6531598429E007B2669 = { + isa = PBXGroup; + children = ( + C1C7B6681598429E007B2669 /* GKImagePicker */, + C1C7B6611598429E007B2669 /* Frameworks */, + C1C7B65F1598429E007B2669 /* Products */, + ); + sourceTree = ""; + }; + C1C7B65F1598429E007B2669 /* Products */ = { + isa = PBXGroup; + children = ( + C1C7B65E1598429E007B2669 /* GKImagePicker.app */, + ); + name = Products; + sourceTree = ""; + }; + C1C7B6611598429E007B2669 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C1C7B6621598429E007B2669 /* UIKit.framework */, + C1C7B6641598429E007B2669 /* Foundation.framework */, + C1C7B6661598429E007B2669 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C1C7B6681598429E007B2669 /* GKImagePicker */ = { + isa = PBXGroup; + children = ( + C1C7B6C6159842EA007B2669 /* Classes */, + C1C7B6711598429E007B2669 /* AppDelegate.h */, + C1C7B6721598429E007B2669 /* AppDelegate.m */, + C1C7B6E015984328007B2669 /* ViewController.h */, + C1C7B6E115984328007B2669 /* ViewController.m */, + C1C7B6771598429E007B2669 /* ViewController_iPhone.xib */, + C1C7B67A1598429E007B2669 /* ViewController_iPad.xib */, + C1C7B6691598429E007B2669 /* Supporting Files */, + ); + path = GKImagePicker; + sourceTree = ""; + }; + C1C7B6691598429E007B2669 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C147FBF51677C12F0035B373 /* Default-568h@2x.png */, + C1C7B66A1598429E007B2669 /* GKImagePicker-Info.plist */, + C1C7B66B1598429E007B2669 /* InfoPlist.strings */, + C1C7B66E1598429E007B2669 /* main.m */, + C1C7B6701598429E007B2669 /* GKImagePicker-Prefix.pch */, + C1C7B6E215984338007B2669 /* Localizable.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C1C7B6C6159842EA007B2669 /* Classes */ = { + isa = PBXGroup; + children = ( + C1C7B6CF15984306007B2669 /* Images */, + C1C7B6C7159842F9007B2669 /* GKImagePicker.h */, + C1C7B6C8159842F9007B2669 /* GKImagePicker.m */, + C1C7B6C9159842F9007B2669 /* GKImageCropViewController.h */, + C1C7B6CA159842F9007B2669 /* GKImageCropViewController.m */, + C1C7B6CB159842F9007B2669 /* GKImageCropView.h */, + C1C7B6CC159842F9007B2669 /* GKImageCropView.m */, + C1C7B6CD159842F9007B2669 /* GKImageCropOverlayView.h */, + C1C7B6CE159842F9007B2669 /* GKImageCropOverlayView.m */, + D696F4F816111C28007802E6 /* GKCropBorderView.h */, + D696F4F916111C28007802E6 /* GKCropBorderView.m */, + D6862A9016111C68005A5C5C /* GKResizeableCropOverlayView.h */, + D6862A9116111C68005A5C5C /* GKResizeableCropOverlayView.m */, + ); + name = Classes; + sourceTree = ""; + }; + C1C7B6CF15984306007B2669 /* Images */ = { + isa = PBXGroup; + children = ( + C1C7B6D015984313007B2669 /* PLCameraSheetButton@2x.png */, + C1C7B6D115984313007B2669 /* PLCameraSheetButtonPressed@2x.png */, + C1C7B6D215984313007B2669 /* PLCameraSheetDoneButton@2x.png */, + C1C7B6D315984313007B2669 /* PLCameraSheetDoneButtonPressed@2x.png */, + C1C7B6D415984313007B2669 /* PLCameraSheetButton.png */, + C1C7B6D515984313007B2669 /* PLCameraSheetButtonPressed.png */, + C1C7B6D615984313007B2669 /* PLCameraSheetDoneButton.png */, + C1C7B6D715984313007B2669 /* PLCameraSheetDoneButtonPressed.png */, + ); + name = Images; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C1C7B65D1598429E007B2669 /* GKImagePicker */ = { + isa = PBXNativeTarget; + buildConfigurationList = C1C7B67F1598429E007B2669 /* Build configuration list for PBXNativeTarget "GKImagePicker" */; + buildPhases = ( + C1C7B65A1598429E007B2669 /* Sources */, + C1C7B65B1598429E007B2669 /* Frameworks */, + C1C7B65C1598429E007B2669 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GKImagePicker; + productName = GKImagePicker; + productReference = C1C7B65E1598429E007B2669 /* GKImagePicker.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C1C7B6551598429E007B2669 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Georg Kitz"; + }; + buildConfigurationList = C1C7B6581598429E007B2669 /* Build configuration list for PBXProject "GKImagePicker" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C1C7B6531598429E007B2669; + productRefGroup = C1C7B65F1598429E007B2669 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C1C7B65D1598429E007B2669 /* GKImagePicker */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C1C7B65C1598429E007B2669 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C1C7B66D1598429E007B2669 /* InfoPlist.strings in Resources */, + C1C7B6791598429E007B2669 /* ViewController_iPhone.xib in Resources */, + C1C7B67C1598429E007B2669 /* ViewController_iPad.xib in Resources */, + C1C7B6D815984313007B2669 /* PLCameraSheetButton@2x.png in Resources */, + C1C7B6D915984313007B2669 /* PLCameraSheetButtonPressed@2x.png in Resources */, + C1C7B6DA15984313007B2669 /* PLCameraSheetDoneButton@2x.png in Resources */, + C1C7B6DB15984313007B2669 /* PLCameraSheetDoneButtonPressed@2x.png in Resources */, + C1C7B6DC15984313007B2669 /* PLCameraSheetButton.png in Resources */, + C1C7B6DD15984313007B2669 /* PLCameraSheetButtonPressed.png in Resources */, + C1C7B6DE15984313007B2669 /* PLCameraSheetDoneButton.png in Resources */, + C1C7B6DF15984313007B2669 /* PLCameraSheetDoneButtonPressed.png in Resources */, + C1C7B6E315984338007B2669 /* Localizable.strings in Resources */, + C147FBF61677C12F0035B373 /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C1C7B65A1598429E007B2669 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C1C7B6E515984465007B2669 /* GKImagePicker.m in Sources */, + C1C7B6E615984465007B2669 /* GKImageCropViewController.m in Sources */, + C1C7B6E715984465007B2669 /* GKImageCropView.m in Sources */, + C1C7B6E815984465007B2669 /* GKImageCropOverlayView.m in Sources */, + C1C7B6E41598445C007B2669 /* ViewController.m in Sources */, + C1C7B66F1598429E007B2669 /* main.m in Sources */, + C1C7B6731598429E007B2669 /* AppDelegate.m in Sources */, + D696F4FA16111C28007802E6 /* GKCropBorderView.m in Sources */, + D6862A9216111C68005A5C5C /* GKResizeableCropOverlayView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + C1C7B66B1598429E007B2669 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + C1C7B66C1598429E007B2669 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + C1C7B6771598429E007B2669 /* ViewController_iPhone.xib */ = { + isa = PBXVariantGroup; + children = ( + C1C7B6781598429E007B2669 /* en */, + ); + name = ViewController_iPhone.xib; + sourceTree = ""; + }; + C1C7B67A1598429E007B2669 /* ViewController_iPad.xib */ = { + isa = PBXVariantGroup; + children = ( + C1C7B67B1598429E007B2669 /* en */, + ); + name = ViewController_iPad.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C1C7B67D1598429E007B2669 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C1C7B67E1598429E007B2669 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C1C7B6801598429E007B2669 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "GKImagePicker/GKImagePicker-Prefix.pch"; + INFOPLIST_FILE = "GKImagePicker/GKImagePicker-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(FRANK_LIBRARY_SEARCH_PATHS)", + ); + OTHER_LDFLAGS = ( + "$(inherited)", + "$(FRANK_LDFLAGS)", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + C1C7B6811598429E007B2669 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "GKImagePicker/GKImagePicker-Prefix.pch"; + INFOPLIST_FILE = "GKImagePicker/GKImagePicker-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C1C7B6581598429E007B2669 /* Build configuration list for PBXProject "GKImagePicker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C1C7B67D1598429E007B2669 /* Debug */, + C1C7B67E1598429E007B2669 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C1C7B67F1598429E007B2669 /* Build configuration list for PBXNativeTarget "GKImagePicker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C1C7B6801598429E007B2669 /* Debug */, + C1C7B6811598429E007B2669 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C1C7B6551598429E007B2669 /* Project object */; +} diff --git a/GKImagePicker/GKImagePicker-Info.plist b/GKImagePicker/GKImagePicker-Info.plist index 004ad12..41a1f0c 100644 --- a/GKImagePicker/GKImagePicker-Info.plist +++ b/GKImagePicker/GKImagePicker-Info.plist @@ -11,7 +11,7 @@ CFBundleIdentifier com.aurora-apps.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion - 6.0 + 7.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType diff --git a/GKImagePicker/Localizable.strings b/GKImagePicker/Localizable.strings index 0af72f8..bf459d1 100644 --- a/GKImagePicker/Localizable.strings +++ b/GKImagePicker/Localizable.strings @@ -6,8 +6,10 @@ Copyright (c) 2012 Aurora Apps. All rights reserved. */ -"GKIchoosePhoto" = "Choose Photo"; -"GKIuse" = "Use"; -"GKImoveAndScale" = "Move and Scale"; -"GKIcancel" = "Cancel"; -"GKIuse" = "Choose"; \ No newline at end of file +"Choose Photo" = "Choose Photo"; +"Use" = "Use"; +"Move and Scale" = "Move and Scale"; +"Cancel" = "Cancel"; + +"Image from Camera" = "Image from Camera"; +"Image from Library" = "Image from Library"; \ No newline at end of file diff --git a/GKImagePicker/ViewController.m b/GKImagePicker/ViewController.m index 91cebdc..5ee070e 100644 --- a/GKImagePicker/ViewController.m +++ b/GKImagePicker/ViewController.m @@ -18,6 +18,7 @@ @interface ViewController () - 1536 - 12A206j - 2519 - 1172.1 - 613.00 + 1280 + 13A603 + 4514 + 1265 + 695.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1856 + 3746 IBProxyObject @@ -31,11 +31,9 @@ IBCocoaTouchFramework - + 274 {{0, 20}, {320, 460}} - - 3 MC43NQA @@ -98,23 +96,21 @@ 7 - - - - ViewController - UIViewController - - IBProjectSource - ./Classes/ViewController.h - - - - + 0 IBCocoaTouchFramework + YES + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + YES 3 YES - 1856 + 3746 diff --git a/GKImagePicker@arkuana.podspec b/GKImagePicker@arkuana.podspec new file mode 100644 index 0000000..a052a96 --- /dev/null +++ b/GKImagePicker@arkuana.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |s| + s.name = 'GKImagePicker@arkuana' + s.version = '0.0.3' + s.license = 'MIT' + s.platform = :ios, '7.0' + s.summary = 'Image Picker with support for custom crop areas.' + s.description = 'A fork of GKImagePicker (0.0.1) updated for iOS 7, that also takes care of the default sources.' + s.homepage = 'https://github.com/arkuana/AKImagePicker' + s.author = { 'Georg Kitz' => 'info@aurora-apps.com', 'Ahmed Khalaf' => 'ahmed@arkuana.co' } + s.source = { :git => 'https://github.com/arkuana/GKImagePicker.git', :tag => s.version.to_s } + s.resources = 'GKImages/*.png' + s.source_files = 'GKClasses/*.{h,m}' + s.preserve_paths = 'GKClasses', 'GKImages' + s.frameworks = 'UIKit' + s.requires_arc = true +end diff --git a/README.md b/README.md index 8021ab5..d59f7c9 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,24 @@ -### GKImagePicker +### GKImagePicker -Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with _GKImagePicker_. Just set your custom crop area and that's it. Just 4 lines of code. If you don't set it, it uses the same crop area as the default UIImagePickerController. +A fork of [GKImagePicker](https://github.com/gekitz/GKImagePicker) by [@gekitz](http://www.twitter.com/gekitz), taking off in a slightly different tangent. Notable changes to it are: +- Utilizes an image cropper similar to Apple's own iOS 7 redesign +- Uses the available space of the screen as much as possible regardless of the size of the image being cropped. Also ensures that large crop sizes are scaled to still fit in the screen. ### How to use it -- just drag and drop the files in under "GKClasses" & "GKImages" into your project. -- look at the sample code below. -- this project contains a sample project as well, just have a look at the implementation of `ViewController.m` -- have fun and follow [@gekitz](http://www.twitter.com/gekitz). - +- Follow the instructions found [here](https://github.com/gekitz/GKImagePicker). ### Sample Code - - self.imagePicker = [[GKImagePicker alloc] init]; - self.imagePicker.cropSize = CGSizeMake(320, 90); + + self.imagePicker = [[GKImagePicker alloc] init]; + self.imagePicker.cropSize = CGSizeMake(320, 496); self.imagePicker.delegate = self; - [self presentModalViewController:self.imagePicker.imagePickerController animated:YES]; - - -This code results into the following controller + crop area: + [self.imagePicker showActionSheetOnViewController:self onPopoverFromView:btn]; -![Sample Crop Image](https://dl.dropbox.com/u/311618/GKImageCrop/IMG_1509.PNG) - -It's even possible to let the user adjust the crop area (thanks to [@pathonhauser](http://www.twitter.com/pathonhauser) for this pull request) by setting one additional property: - - self.imagePicker.resizeableCropArea = YES; - -This code results into the following controller + adjustable crop area: -![Sample Crop Image Adjustable](https://dl.dropbox.com/u/311618/GKImageCrop/IMG_2299.PNG) ### License Under MIT. See license file for details. - \ No newline at end of file +