dzenbot/DZNPhotoPickerController

Different pod files in sample and realise

Closed this issue · 7 comments

S2V commented

Hello guys - thanks for your work.
I have a problem - when I use pod try - in sample for photo picker I see one version of UIImagePickerController+Edit.h. But when I import pod in my project I have other version this category.
First version contain full fuctionallity, but other - only:

#import "UIImagePickerController+Edit.h"

static DZNPhotoEditorViewControllerCropMode _cropMode;

@implementation UIImagePickerController (Edit)

- (void)setCropMode:(DZNPhotoEditorViewControllerCropMode)mode
{
    self.allowsEditing = NO;
    _cropMode = mode;

    switch (mode) {
        case DZNPhotoEditorViewControllerCropModeNone:
            [[NSNotificationCenter defaultCenter] removeObserver:self name:DZNPhotoPickerDidFinishPickingNotification object:nil];
            break;

        default:
            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didPickImage:) name:DZNPhotoPickerDidFinishPickingNotification object:nil];
            break;
    }
}

- (DZNPhotoEditorViewControllerCropMode)cropMode
{
    return _cropMode;
}

- (void)didPickImage:(NSNotification *)notification
{
    if (!self.allowsEditing && self.delegate &&
        [self.delegate respondsToSelector:@selector(imagePickerController:didFinishPickingMediaWithInfo:)]) {

        if ([[notification.userInfo allKeys] containsObject:UIImagePickerControllerEditedImage]) {
            self.cropMode = DZNPhotoEditorViewControllerCropModeNone;
        }

        [self.delegate imagePickerController:self didFinishPickingMediaWithInfo:notification.userInfo];
    }

    [[NSNotificationCenter defaultCenter] removeObserver:self name:DZNPhotoPickerDidFinishPickingNotification object:nil];
}

@end

That's definitely weird. Probably you're trying a different version that the one you're installing?
Check on pod.lock file and compare them both.

S2V commented

My project (pod 'DZNPhotoPickerController'):

 - DZNPhotoPickerController (1.4.5):
    - AFNetworking (~> 2.2)
    - DZNEmptyDataSet
    - DZNPhotoPickerController/UIImagePickerControllerExtended (= 1.4.5)
    - SDWebImage (~> 3.6)
  - DZNPhotoPickerController/UIImagePickerControllerExtended (1.4.5):
    - AFNetworking (~> 2.2)
    - DZNEmptyDataSet
    - SDWebImage (~> 3.6)

In sample (pod 'DZNPhotoPickerController', :path => '../../'):

 - DZNPhotoPickerController (2.0):
    - DZNPhotoPickerController/Core (= 2.0)
  - DZNPhotoPickerController/Core (2.0):
    - DZNEmptyDataSet (~> 1.7)
    - DZNPhotoPickerController/Editor
    - DZNPhotoPickerController/Services
    - SDWebImage (~> 3.7)
  - DZNPhotoPickerController/Editor (2.0)
  - DZNPhotoPickerController/Services (2.0):

There you go: you project uses 1.4.5 and the sample/try project uses 2.0

Try updating to 2.0 if that's what you need

S2V commented

@dzenbot Problem in Podfile.lock - I deleted him and all work fine . Thank you for help.

I face this issue very often: it's basically because of some versioning conflicts in Cocoapods.
You should try installing the clean plugin for Cocoapods, which removes all traces of Cocoapods in your project so you can do a clean install. It's amazing!

S2V commented

@dzenbot What do you mean

plugin for Cocoapods

Something like plugins in Alcatraz for Xcode?