Skip to content

Instantly share code, notes, and snippets.

@ahmetardal
Created October 17, 2011 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmetardal/1292278 to your computer and use it in GitHub Desktop.
Save ahmetardal/1292278 to your computer and use it in GitHub Desktop.
SSPhotoCropperViewController
@protocol SSPhotoCropperDelegate<NSObject>
@optional
- (void) photoCropper:(SSPhotoCropperViewController *)photoCropper
didCropPhoto:(UIImage *)photo;
- (void) photoCropperDidCancel:(SSPhotoCropperViewController *)photoCropper;
@end
#pragma -
#pragma SSPhotoCropperDelegate Methods
- (void) photoCropper:(SSPhotoCropperViewController *)photoCropper
didCropPhoto:(UIImage *)photo
{
self.croppedPhoto = photo;
self.photoPreviewImageView.image = photo;
[photoCropper dismissModalViewControllerAnimated:YES];
}
- (void) photoCropperDidCancel:(SSPhotoCropperViewController *)photoCropper
{
[photoCropper dismissModalViewControllerAnimated:YES];
}
SSPhotoCropperViewController *photoCropper =
[[SSPhotoCropperViewController alloc] initWithPhoto:photo
delegate:self
uiMode:SSPCUIModePresentedAsModalViewController
showsInfoButton:YES];
[photoCropper setMinZoomScale:0.75f];
[photoCropper setMaxZoomScale:1.50f];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:photoCropper];
[self presentModalViewController:nc animated:YES];
[photoCropper release];
[nc release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment