iOS 仿微信图片选择器-基于Photos框架

2019-11-14  本文已影响0人  ricefun

基于Photos框架,一句话搞定图片获取; demo地址

IMG_4002.GIF IMG_4006.GIF

主要方法

//拍照获取图片
- (void)rf_PhotoWithTakePhoto_targetVC:(UIViewController *)targetVC callBack:(RFPhotoManagerCallBack)callBack;
//相册获取图片
- (void)rf_PhotoWithAlbum_targetVC:(UIViewController *)targetVC callBack:(RFPhotoManagerCallBack)callBack;

使用

拍照
- (void)takePhoto:(UIBarButtonItem *)item {
    __weak __typeof(self)weakSelf = self;
    [[RFPhotoManager sharedInstance] rf_PhotoWithTakePhoto_targetVC:self callBack:^(NSArray * _Nonnull photos) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf setTextViewWithPhotos:photos];
    }];
}

相册
-(void)enterPhotoAlbum:(UIBarButtonItem *)item{
    __weak __typeof(self)weakSelf = self;
    [[RFPhotoManager sharedInstance] rf_PhotoWithAlbum_targetVC:self callBack:^(NSArray * _Nonnull photos) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        [strongSelf setTextViewWithPhotos:photos];
    }];
}

如果这篇文章对您有用,烦请点个赞,谢谢

上一篇 下一篇

猜你喜欢

热点阅读