代码拉取完成,页面将自动刷新
#import <PureCamera.h>
#import "PureCamera.h"
Privacy - Camera Usage Description Use camera
PureCamera *homec=[[PureCamera alloc]init];
__weak typeof(self)myself=self;
homec.fininshcapture=^(UIImage *ss){
if (ss) {
NSLog(@"Photo exists");
//Here you can get the cropped photo
myself.ViewImageview.image=ss;
}
} ;
[self presentViewController:homec animated:NO completion:^{}];}
First import #import "TOCropViewController.h"
Adhere to @interface ViewController()<TOCropViewControllerDelegate>
Pass in an image and you can present the image cropping page
TOCropViewController *cropController = [[TOCropViewController alloc] initWithImage:self.cropImageview.image];
cropController.delegate = self;
[self presentViewController:cropController animated:YES completion:nil];
- (void)cropViewController:(TOCropViewController *)cropViewController didCropToImage:(UIImage *)image withRect:(CGRect)cropRect angle:(NSInteger)angle
{
self.cropImageview.image=image;
self.navigationItem.rightBarButtonItem.enabled = YES;
//The following defines an animation effect, which is that when the image cropping page disappears, it will use the frame of the view you defined as the boundary after the disappearance.
CGRect viewFrame = [self.view convertRect:self.cropImageview.frame toView:self.navigationController.view];
[cropViewController dismissAnimatedFromParentViewController:self withCroppedImage:image toFrame:viewFrame completion:^{
}];
}
If you encounter any problems during use, please feel free to submit an issue.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。