-
-
Save gliubc/b9324ab4ba3c72da9d7844d7697ba0a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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