JSImagePickerController
JSImagePickerController copied to clipboard
hi there
hi, i am a beginner ios developer and i am willing to use your code in my test app. I am trying to add photos to imageviews but i also want to crop the image after selection with a circle crop just like this :http://i.stack.imgur.com/cdFdE.png
can you please help me to that. I want this screen to come after choosing the image
I might add this as a feature to the control at some point if I get the time but if you wish to do it yourself then look at the allowsEditing property of the UIImagePickerController class and edit in the JSImagePickerController source code.
Have a look here: https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImagePickerController_Class/index.html#//apple_ref/occ/instp/UIImagePickerController/allowsEditing https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImagePickerController_Class/index.html#//apple_ref/occ/instp/UIImagePickerController/allowsEditing
On 15 Mar 2015, at 16:15, denigada [email protected] wrote:
hi, i am a beginner ios developer and i am willing to use your code in my test app. I am trying to add photos to imageviews but i also want to crop the image after selection with a circle crop just like this :http://i.stack.imgur.com/cdFdE.png http://i.stack.imgur.com/cdFdE.png can you please help me to that. I want this screen to come after choosing the image
— Reply to this email directly or view it on GitHub https://github.com/jacobsieradzki/JSImagePickerController/issues/3.
I dont have the enough development knowledge to make this happen :( If you have time to add this feature, i would really appreciate your help. By the way sorry if my english is bad
and i try to make 2 image pickers. i try this:
-
(void)addPhoto1:(id)sender { JSImagePickerViewController *imagePicker = [[JSImagePickerViewController alloc] init]; imagePicker.delegate = self;
[imagePicker showImagePickerInController:self animated:YES]; }
-
(IBAction)addPhoto2:(id)sender { JSImagePickerViewController *imagePicker2 = [[JSImagePickerViewController alloc] init]; imagePicker2.delegate = self;
[imagePicker2 showImagePickerInController:self animated:YES]; }
But how can i identify the picker in - (void)imagePickerDidSelectImage:(UIImage *)image { method ??
Like do this if picker2 used or to that if picker 1 was used
You could always try and add a tag property to the JSImagePickerController as an int, and also include the JSImagePickerController object in the imagePickerDidSelectImage method. Like I said I don’t have time at the moment but thanks for the idea for an update.
But you could try what I said so it would work like this:
-
(void)addPhoto1:(id)sender { JSImagePickerController *imagePicker = [[JSImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.tag = 1;
[imagePicker showImagePickerInController:self animated:YES]; }
-
(void)addPhoto2:(id)sender { JSImagePickerController *imagePicker = [[JSImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.tag = 2;
[imagePicker showImagePickerInController:self animated:YES]; }
-
(void)imagePicker:(JSImagePickerController *)imagePicker didSelectImage:(UIImage *)image { if (imagePicker.tag == 1) { // This delegate was sent from [self addPhoto1:(id)sender]; } else { // This delegate was sent from [self addPhoto2:(id)sender]; } }
Cheers,
Jake Sieradzki
On 16 Mar 2015, at 22:42, denigada [email protected] wrote:
and i try to make 2 image pickers. i try this:
(void)addPhoto1:(id)sender { JSImagePickerViewController *imagePicker = [[JSImagePickerViewController alloc] init]; imagePicker.delegate = self;
[imagePicker showImagePickerInController:self animated:YES]; }
(IBAction)addPhoto2:(id)sender { JSImagePickerViewController *imagePicker2 = [[JSImagePickerViewController alloc] init]; imagePicker2.delegate = self;
[imagePicker2 showImagePickerInController:self animated:YES]; }
But how can i identify the picker in - (void)imagePickerDidSelectImage:(UIImage *)image { method ??
Like do this if picker2 used or to that if picker 1 was used
— Reply to this email directly or view it on GitHub https://github.com/jacobsieradzki/JSImagePickerController/issues/3#issuecomment-81970764.
i get this error at the line of imagePicker.tag =1 : Property 'tag' not found on object of type 'JSImagePıckerViewController'
I really appreciate your help
EDIT: i managed to do it. really thank you. my only problem now is cropping the image after selection
Yes, the tag is only inherited from the UIView class which UIImagePickerController does not inherit from, so you have to manually put it in by adding a property to JSImagePickerController.h
Sent from my iPhone
On 16 Mar 2015, at 10:56 pm, denigada [email protected] wrote:
i get this error at the line of imagePicker.tag =1 : Property 'tag' not found on object of type 'JSImagePıckerViewController'
I really appreciate your help
— Reply to this email directly or view it on GitHub.
Just made a PR. I'm not too familiar with with delegates, but I think this is better solution.