Skip to content

hi there #3

Open
Open

Description

@denigada

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

Activity

  1. jacobsieradzki commented on Mar 15, 2015

    @jacobsieradzki
    Owner

    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 notifications@github.com 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 #3.

  2. denigada commented on Mar 15, 2015

    @denigada
    Author

    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

  3. denigada commented on Mar 16, 2015

    @denigada
    Author

    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

  4. jacobsieradzki commented on Mar 16, 2015

    @jacobsieradzki
    Owner

    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 notifications@github.com 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 #3 (comment).

  5. denigada commented on Mar 16, 2015

    @denigada
    Author

    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

  6. jacobsieradzki commented on Mar 16, 2015

    @jacobsieradzki
    Owner

    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 notifications@github.com 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.

  7. pahnev commented on Apr 23, 2015

    @pahnev

    Just made a PR. I'm not too familiar with with delegates, but I think this is better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions