Skip to content

Instantly share code, notes, and snippets.

@gliubc
Last active July 12, 2019 09:02
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 gliubc/b9324ab4ba3c72da9d7844d7697ba0a0 to your computer and use it in GitHub Desktop.
Save gliubc/b9324ab4ba3c72da9d7844d7697ba0a0 to your computer and use it in GitHub Desktop.
#import "HXPhotoPicker.h"
@property (strong, nonatomic) HXPhotoManager *manager;
- (HXPhotoManager *)manager {
if (!_manager) {
_manager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypePhoto];
_manager.configuration.restoreNavigationBar = YES;
_manager.configuration.albumShowMode = HXPhotoAlbumShowModePopup;
_manager.configuration.singleSelected = YES;
_manager.configuration.singleJumpEdit = YES;
_manager.configuration.movableCropBox = YES;
_manager.configuration.movableCropBoxEditSize = YES;
_manager.configuration.movableCropBoxCustomRatio = CGPointMake(1, 1);
}
return _manager;
}
@weakify(self);
[self hx_presentSelectPhotoControllerWithManager:self.manager didDone:^(NSArray<HXPhotoModel *> *allList, NSArray<HXPhotoModel *> *photoList, NSArray<HXPhotoModel *> *videoList, BOOL isOriginal, UIViewController *viewController, HXPhotoManager *manager) {
@strongify(self);
HXPhotoModel *model = allList.firstObject;
UIImage *image = [Util getImageFromHXPhotoModel:model];
self.imageAvatar.image = image;
} cancel:^(UIViewController *viewController, HXPhotoManager *manager) {
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment