美文网首页
iOS 仿微信图片选择器-基于Photos框架

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

作者: ricefun | 来源:发表于2019-11-14 15:12 被阅读0次

基于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];
    }];
}

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

相关文章

网友评论

      本文标题:iOS 仿微信图片选择器-基于Photos框架

      本文链接:https://www.haomeiwen.com/subject/kuyrictx.html