美文网首页iOS 实际项目出现的问题
iOS图片剪切第三方TZImagePickerControlle

iOS图片剪切第三方TZImagePickerControlle

作者: 江河_ios | 来源:发表于2017-12-15 17:09 被阅读69次

在项目上总会遇到上传用户头像的功能,上传的时候图片过大造成用户体验不是太好,需要对图片进行剪切达到快速上传的用户体验. 简单介绍一个第三方TZImagePickerController.如何添加到项目不再介绍.......

使用代码

导入头文件 并实现代理>>>>> TZImagePickerControllerDelegate

#import "TZImagePickerController.h"

#import "TZAssetModel.h"

#import "TZImageManager.h"

点击按钮的操作如下:

TZImagePickerController *pickerController = [[TZImagePickerController alloc]initWithMaxImagesCount:1 columnNumber:6 delegate:self pushPhotoPickerVc:YES]; pickerController.allowCrop = YES; pickerController.needCircleCrop = YES; pickerController.circleCropRadius = 120; [pickerController setDidFinishPickingPhotosHandle:^(NSArray*photo, NSArray * assets, BOOL isSelectOriginalPhoto) {

//        self.selectArray= photo.mutableCopy;

self.imgView.image=photo.lastObject; //图片剪切后的展示

NSLog(@"photo 图片剪切== %@, assets == %@",photo,assets);

}];

[self presentViewController:pickerController animated:YES completion:nil];

相关文章

网友评论

    本文标题:iOS图片剪切第三方TZImagePickerControlle

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