Commit 9b3f86d1 by ludi

修改处理图片页面

parent e7091848
......@@ -63,5 +63,6 @@ Pod::Spec.new do |s|
s.dependency 'ZipArchive'
s.dependency 'TalkingData/Full'
s.dependency 'HWPanModal'
s.dependency 'Masonry'
end
//
// FUSRotationCropperImageViewController.h
// FuSiLive
//
// Created by aaa on 2024/6/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class FUSRotationCropperImageViewController;
@protocol FUSRotationCropperImageDelegate <NSObject>
@optional
-(void)fus_imageCropper:(FUSRotationCropperImageViewController *)controller didFinished:(UIImage *)editedImage;
- (void)fus_imageCropperDidCancel:(FUSRotationCropperImageViewController *)controller;
@end
@interface FUSRotationCropperImageViewController : UIViewController
@property (nonatomic, assign) NSInteger tag;
@property (nonatomic, weak) id<FUSRotationCropperImageDelegate>delegate;
- (FUSRotationCropperImageViewController *)initWithImage:(UIImage *)originalImage maxScaleRatio:(CGFloat)maxScale;
@end
NS_ASSUME_NONNULL_END
//
// FUSRotationCropperImageViewController.m
// FuSiLive
//
// Created by aaa on 2024/6/19.
//
#import "FUSRotationCropperImageViewController.h"
#import "LDImageCropperView.h"
#import "FUSToolSet.h"
#import <Masonry/Masonry.h>
@interface FUSRotationCropperImageViewController ()
@property (nonatomic, strong) LDImageCropperView *cropperView;
@property (nonatomic, assign) CGFloat maxScale;
@property (nonatomic, strong) UIImage *originalImage;
@end
@implementation FUSRotationCropperImageViewController
- (FUSRotationCropperImageViewController *)initWithImage:(UIImage *)originalImage maxScaleRatio:(CGFloat)maxScale{
self = [super init];
if (self) {
self.maxScale = maxScale;
self.originalImage = originalImage;
}
return self;
}
- (void)viewDidLoad{
[super viewDidLoad];
self.navigationController.navigationBarHidden = YES;
self.view.backgroundColor = [UIColor blackColor];
[self fus_createUI];
}
-(void)fus_createUI{
CGFloat safeTop = [UIApplication sharedApplication].keyWindow.safeAreaInsets.top;
safeTop = safeTop < 20 ? 20 : safeTop;
CGFloat safeBottom = [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
UIView *naviView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, screenWidth, safeTop + 44)];
// naviView.backgroundColor = [UIColor blackColor];
[self.view addSubview:naviView];
UIView *naviContentView = [[UIView alloc] initWithFrame:CGRectMake(0, safeTop, screenWidth, 44)];
[naviView addSubview:naviContentView];
UIButton *returnBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[returnBtn setImage:[UIImage imageNamed:@"common_navigation_back_white"] forState:UIControlStateNormal];
returnBtn.frame = CGRectMake(0, 0, 44, 44);
[naviContentView addSubview:returnBtn];
[returnBtn addTarget:self action:@selector(fus_returnBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UILabel *contentTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
contentTitleLabel.font = [UIFont systemFontOfSize:18];
contentTitleLabel.text = FUSLocalizationHelper.versionLocalString(@"更換頭像");
contentTitleLabel.textColor = [UIColor whiteColor];
contentTitleLabel.textAlignment = NSTextAlignmentCenter;
[naviContentView addSubview:contentTitleLabel];
contentTitleLabel.center = CGPointMake(naviContentView.frame.size.width / 2.0f, naviContentView.frame.size.height / 2.0f);
self.cropperView = [[LDImageCropperView alloc] initWithCropImage:self.originalImage cropSize:CGSizeMake(screenWidth, screenWidth)];
self.cropperView.maxScale = self.maxScale;
self.cropperView.frame = CGRectMake(0, CGRectGetMaxY(naviView.frame), screenWidth, screenWidth + 100);
[self.view addSubview:self.cropperView];
UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.cropperView.frame), screenWidth, screenHeight - CGRectGetMaxY(self.cropperView.frame))];
[self.view addSubview:bottomView];
UIView *controlView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 68)];
[bottomView addSubview:controlView];
UIButton *rotationBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[rotationBtn setImage:[UIImage imageNamed:@"fus_common_imageCropper_rotation_icon"] forState:UIControlStateNormal];
rotationBtn.frame = CGRectMake(0, 0, controlView.height, controlView.height);
[controlView addSubview:rotationBtn];
[rotationBtn addTarget:self action:@selector(fus_rotationBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UIButton *restoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[restoreBtn setTitle:FUSLocalizationHelper.versionLocalString(@"還原") forState:UIControlStateNormal];
restoreBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[restoreBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[controlView addSubview:restoreBtn];
CGSize btnSize = [FUSLocalizationHelper.versionLocalString(@"還原") sizeWithFont:restoreBtn.titleLabel.font maxWidth:MAXFLOAT];
restoreBtn.frame = CGRectMake(screenWidth - btnSize.width - 40, 0, btnSize.width + 40, controlView.height);
[restoreBtn addTarget:self action:@selector(fus_restoreBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UIView *confirmView = [[UIView alloc] initWithFrame:CGRectMake(0, bottomView.height - 68 - safeBottom, screenWidth, 60)];
[bottomView addSubview:confirmView];
UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
cancelBtn.titleLabel.font = [UIFont systemFontOfSize:18];
[cancelBtn setTitle:FUSLocalizationHelper.versionLocalString(@"取消") forState:UIControlStateNormal];
[cancelBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[confirmView addSubview:cancelBtn];
// btnSize = [FUSLocalizationHelper.versionLocalString(@"取消") sizeWithFont:cancelBtn.titleLabel.font maxWidth:MAXFLOAT];
cancelBtn.frame = CGRectMake(0, 0, 80, confirmView.height);
[cancelBtn addTarget:self action:@selector(fus_returnBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UIButton *okBtn = [UIButton buttonWithType:UIButtonTypeCustom];
okBtn.titleLabel.font = [UIFont boldSystemFontOfSize:17];
[okBtn setTitle:FUSLocalizationHelper.versionLocalString(@"確認&更換") forState:UIControlStateNormal];
[okBtn setTitleColor:[UIColor colorWithRed:34/255.f green:34/255.f blue:34/255.f alpha:1] forState:UIControlStateNormal];
[okBtn setBackgroundColor:[UIColor colorWithRed:0 green:247/255.f blue:1 alpha:1]];
okBtn.layer.cornerRadius = 20;
okBtn.layer.masksToBounds = YES;
[confirmView addSubview:okBtn];
btnSize = [FUSLocalizationHelper.versionLocalString(@"確認&更換") sizeWithFont:cancelBtn.titleLabel.font maxWidth:MAXFLOAT];
okBtn.frame = CGRectMake(screenWidth - 117 - 13, 12, 117, 40);
[okBtn addTarget:self action:@selector(fus_okBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UIScrollView *tipsScrollView = [[UIScrollView alloc] init];
[bottomView addSubview:tipsScrollView];
[tipsScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.offset(0);
make.top.equalTo(controlView.mas_bottom);
make.bottom.equalTo(confirmView.mas_top);
}];
UIView *tipsContentView = [[UIView alloc] init];
[tipsScrollView addSubview:tipsContentView];
[tipsContentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(tipsScrollView);
make.width.equalTo(tipsScrollView.mas_width);
}];
UILabel *tipsLabel = [[UILabel alloc] init];
tipsLabel.font = [UIFont systemFontOfSize:14];
tipsLabel.textColor = [UIColor colorWithRed:215/255.f green:212/255.f blue:212/255.f alpha:1];
tipsLabel.numberOfLines = 0;
tipsLabel.text = FUSLocalizationHelper.versionLocalString(@"1.請提供高清品質的圖片作為頭像和封面。\n2.請確認您的頭像和封面不涉及違反您所在國法律的內容。\n3.請確認您的頭像和封面沒有涉及暴力和過度暴露、色情的圖片。\n4.請確認您的頭像和封面尊重您社交群體的文化。");
[tipsContentView addSubview:tipsLabel];
[tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.inset(15);
}];
}
#pragma mark --- button did clicked
-(void)fus_returnBtnDidClicked:(UIButton *)btn{
if (self.delegate && [self.delegate respondsToSelector:@selector(fus_imageCropperDidCancel:)]) {
[self.delegate fus_imageCropperDidCancel:self];
}
}
-(void)fus_okBtnDidClicked:(UIButton *)btn{
if (self.delegate && [self.delegate respondsToSelector:@selector(fus_imageCropper:didFinished:)]) {
[self.delegate fus_imageCropper:self didFinished:[self.cropperView getCroppedImage]];
}
}
-(void)fus_rotationBtnDidClicked:(UIButton *)btn{
[self.cropperView actionRotate];
}
-(void)fus_restoreBtnDidClicked:(UIButton *)btn{
[self.cropperView actionRestore];
}
@end
//
// LDImageCropperView.h
// HXPictureClippingRotation
//
//
#import <UIKit/UIKit.h>
@interface LDImageCropperView : UIView
/**
* 图片裁剪初始化
*
* @param cropImage 需要裁剪的图片
* @param cropSize 裁剪框的size 目前裁剪框的宽度为屏幕宽度
*
* @return <#return value description#>
*/
- (id)initWithCropImage:(UIImage*)cropImage cropSize:(CGSize)cropSize;
- (UIImage*)getCroppedImage;//获取裁剪后的图片
/// 最大放大系数,默认2倍
@property (nonatomic ,assign) CGFloat maxScale;
/// 旋转
- (void)actionRotate;
/// 还原
- (void)actionRestore;
- (id)init __deprecated_msg("Use `- (id)initWithCropImage:(UIImage*)cropImage cropSize:(CGSize)cropSize`");
- (id)initWithFrame:(CGRect)frame __deprecated_msg("Use `- (id)initWithCropImage:(UIImage*)cropImage cropSize:(CGSize)cropSize`");
@end
//
// LDImageCropperView.m
// HXPictureClippingRotation
//
//
#define MAX_ZOOMSCALE 3
#import "LDImageCropperView.h"
#import "UIImage+LDScale.h"
#import <UIKit/UIGestureRecognizerSubclass.h>
#import <QuartzCore/QuartzCore.h>
@interface LDImageCropperView() <UIGestureRecognizerDelegate>
@property (nonatomic,strong) UIImage *inputImage;//输入Image
@property (nonatomic,strong) UIImageView *imgView;
@property (nonatomic,assign) CGRect cropRect;//裁剪的rect
@property (nonatomic,strong) UIView *cropperView;
@property (nonatomic,assign) double imageScale;
@property (nonatomic,assign) double translateX;
@property (nonatomic,assign) double translateY;
@property (nonatomic,assign) CGSize realCropsize;
@property (nonatomic, strong) UIView *topView;
@property (nonatomic, strong) UIView *bottomView;
@end
@implementation LDImageCropperView
#pragma mark - initialize
- (id)init {
self = [super init];
if (self) {
self.maxScale = 2.0f;
}
return self;
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.maxScale = 2.0f;
}
return self;
}
- (void)setFrame:(CGRect)frame{
[super setFrame:frame];
if (_imgView) {
_imgView.frame = CGRectMake((frame.size.width - _imgView.frame.size.width) / 2.0f, (frame.size.height - _imgView.frame.size.height) / 2.0f, _imgView.frame.size.width, _imgView.frame.size.height);
_cropperView.frame = CGRectMake((frame.size.width - _cropperView.frame.size.width) / 2.0f, (frame.size.height - _cropperView.frame.size.height) / 2.0f, _cropperView.frame.size.width, _cropperView.frame.size.height);
_cropRect = _cropperView.frame;
if (_cropperView.bounds.size.height >= frame.size.height) {
_topView.hidden = YES;
_bottomView.hidden = YES;
}else {
_topView.hidden = NO;
_bottomView.hidden = NO;
_topView.frame = CGRectMake(0, 0, frame.size.width, _cropRect.origin.y);
_bottomView.frame = CGRectMake(0, _cropRect.origin.y + _cropRect.size.height, frame.size.width, (frame.size.height - _cropRect.size.height)/2);
}
}
}
- (id)initWithCropImage:(UIImage*)cropImage cropSize:(CGSize)cropSize {
self = [super init];
if(self)
{
_translateX =0;
_translateY =0;
self.frame = CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height - 64);
// if(cropImage.size.width <= cropSize.width || cropImage.size.height <= cropSize.height) {
// cropImage = [cropImage resizedImageToFitInSize:CGSizeMake(cropSize.width*1.3, cropSize.height*1.3) scaleIfSmaller:YES];
// }
self.inputImage = cropImage;
if (self.inputImage.size.width / self.inputImage.size.height > cropSize.width / cropSize.height) {
// inputImage更宽,那么就以height作为scale
_imageScale = cropSize.height/self.inputImage.size.height;
}else {
_imageScale = cropSize.width/self.inputImage.size.width;
}
CGRect imgViewBound = CGRectMake(0, 0, _inputImage.size.width*_imageScale, _inputImage.size.height*_imageScale); //이미지가 생성될 사이즈.
_imgView = [[UIImageView alloc] initWithFrame:imgViewBound];
_imgView.center = self.center;
_imgView.image = _inputImage;
_imgView.backgroundColor = [UIColor whiteColor];
_realCropsize = cropSize;
_cropRect = CGRectMake(0, ([[UIScreen mainScreen] bounds].size.height - 64 - cropSize.height)/2, cropSize.width, cropSize.height);
_cropperView = [[UIView alloc] initWithFrame:_cropRect];
_cropperView.backgroundColor = [UIColor clearColor];
_cropperView.layer.borderColor = [UIColor whiteColor].CGColor;
_cropperView.layer.borderWidth = 1.5;
[self addSubview:_imgView];
[self addSubview:_cropperView];
[self setupGestureRecognizer];
_topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, _cropRect.origin.y)];
_topView.backgroundColor = [UIColor clearColor];
_topView.alpha = 0.7;
_topView.userInteractionEnabled = NO;
[self addSubview:_topView];
_bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, _cropRect.origin.y + _cropRect.size.height, [[UIScreen mainScreen] bounds].size.width, ([[UIScreen mainScreen] bounds].size.height - 64 - _cropRect.size.height)/2)];
_bottomView.backgroundColor = [UIColor clearColor];
_bottomView.alpha = 0.7;
_bottomView.userInteractionEnabled = NO;
[self addSubview:_bottomView];
self.clipsToBounds = YES;
}
return self;
}
#pragma mark - UIGestureAction
- (void)zoomAction:(UIGestureRecognizer *)sender {
CGFloat factor = [(UIPinchGestureRecognizer *)sender scale];
static CGFloat lastScale=1;
if([sender state] == UIGestureRecognizerStateBegan) {
lastScale =1;
}
if ([sender state] == UIGestureRecognizerStateChanged
|| [sender state] == UIGestureRecognizerStateEnded) {
CGRect imgViewFrame = _imgView.frame;
// CGFloat minX,minY,maxX,maxY,imgViewMaxX,imgViewMaxY;
// minX= CGRectGetMinX(_cropRect);
// minY= CGRectGetMinY(_cropRect);
// maxX= CGRectGetMaxX(_cropRect);
// maxY= CGRectGetMaxY(_cropRect);
CGFloat currentScale = [[self.imgView.layer valueForKeyPath:@"transform.scale.x"] floatValue];
// const CGFloat kMaxScale = 2.0;
CGFloat newScale = 1 - (lastScale - factor);
newScale = MIN(newScale, self.maxScale / currentScale);
imgViewFrame.size.width = imgViewFrame.size.width * newScale;
imgViewFrame.size.height = imgViewFrame.size.height * newScale;
// imgViewFrame.origin.x = self.imgView.center.x - imgViewFrame.size.width/2;
// imgViewFrame.origin.y = self.imgView.center.y - imgViewFrame.size.height/2;
//
// imgViewMaxX= CGRectGetMaxX(imgViewFrame);
// imgViewMaxY= CGRectGetMaxY(imgViewFrame);
//
// NSInteger collideState = 0;
//
// if(imgViewFrame.origin.x >= minX)
// {
// collideState = 1;
// }
// else if(imgViewFrame.origin.y >= minY)
// {
// collideState = 2;
// }
// else if(imgViewMaxX <= maxX)
// {
// collideState = 3;
// }
// else if(imgViewMaxY <= maxY)
// {
// collideState = 4;
// }
//
// if(collideState >0)
// {
//
// if(lastScale - factor <= 0)
// {
// lastScale = factor;
// CGAffineTransform transformN = CGAffineTransformScale(self.imgView.transform, newScale, newScale);
// self.imgView.transform = transformN;
// }
// else
// {
// lastScale = factor;
//
// CGPoint newcenter = _imgView.center;
//
// if(collideState ==1 || collideState ==3)
// {
// newcenter.x = _cropperView.center.x;
// }
// else if(collideState ==2 || collideState ==4)
// {
// newcenter.y = _cropperView.center.y;
// }
//
// [UIView animateWithDuration:0.5f animations:^(void) {
//
// self.imgView.center = newcenter;
// [sender reset];
//
// } ];
//
// }
//
// }
// else
// {
// CGAffineTransform transformN = CGAffineTransformScale(self.imgView.transform, newScale, newScale);
// self.imgView.transform = transformN;
// lastScale = factor;
// }
if (imgViewFrame.size.width == _cropRect.size.width || imgViewFrame.size.height == _cropRect.size.height) {
return;
}
if (imgViewFrame.size.width < _cropRect.size.width || imgViewFrame.size.height < _cropRect.size.height) {
newScale = 1;
}
CGAffineTransform transformN = CGAffineTransformScale(self.imgView.transform, newScale, newScale);
self.imgView.transform = transformN;
lastScale = factor;
[self resizeImageToCenterFit];
}
}
- (void)panAction:(UIPanGestureRecognizer *)gesture {
static CGPoint prevLoc;
CGPoint location = [gesture locationInView:self];
if(gesture.state == UIGestureRecognizerStateBegan)
{
prevLoc = location;
}
if ((gesture.state == UIGestureRecognizerStateChanged) || (gesture.state == UIGestureRecognizerStateEnded))
{
CGFloat minX,minY,maxX,maxY,imgViewMaxX,imgViewMaxY;
_translateX = (location.x - prevLoc.x);
_translateY = (location.y - prevLoc.y);
CGPoint center = self.imgView.center;
minX= CGRectGetMinX(_cropRect);
minY= CGRectGetMinY(_cropRect);
maxX= CGRectGetMaxX(_cropRect);
maxY= CGRectGetMaxY(_cropRect);
center.x =center.x +_translateX;
center.y = center.y +_translateY;
imgViewMaxX= center.x + _imgView.frame.size.width/2;
imgViewMaxY= center.y+ _imgView.frame.size.height/2;
if( (center.x - (_imgView.frame.size.width/2) ) >= minX)
{
center.x = minX + (_imgView.frame.size.width/2) ;
}
if( center.y - (_imgView.frame.size.height/2) >= minY)
{
center.y = minY + (_imgView.frame.size.height/2) ;
}
if(imgViewMaxX <= maxX)
{
center.x = maxX - (_imgView.frame.size.width/2);
}
if(imgViewMaxY <= maxY)
{
center.y = maxY - (_imgView.frame.size.height/2);
}
self.imgView.center = center;
prevLoc = location;
}
}
- (void)RotationAction:(UIGestureRecognizer *)sender {
UIRotationGestureRecognizer *recognizer = (UIRotationGestureRecognizer *) sender;
static CGFloat rot=0;
if(sender.state == UIGestureRecognizerStateBegan)
{
rot = recognizer.rotation;
}
if(sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateChanged)
{
self.imgView.transform = CGAffineTransformRotate(self.imgView.transform, recognizer.rotation - rot);
rot =recognizer.rotation;
}
if (sender.state == UIGestureRecognizerStateEnded) {
if(self.imgView.frame.size.width < _cropperView.frame.size.width || self.imgView.frame.size.height < _cropperView.frame.size.height)
{
double scale = MAX(_cropperView.frame.size.width/self.imgView.frame.size.width,_cropperView.frame.size.height/self.imgView.frame.size.height) + 0.01;
self.imgView.transform = CGAffineTransformScale(self.imgView.transform,scale, scale);
}
}
}
- (void)DoubleTapAction:(UIGestureRecognizer *)sender
{
//双击放大或者还原
if (self.imgView.transform.a > 1 && self.imgView.transform.d > 1) {
[UIView animateWithDuration:0.2f animations:^(void) {
self.imgView.transform = CGAffineTransformIdentity;
self.imgView.center = self->_cropperView.center;
} ];
} else {
[UIView animateWithDuration:0.2f animations:^(void) {
self.imgView.transform = CGAffineTransformScale(self.imgView.transform,2.0, 2.0);
self.imgView.center = self->_cropperView.center;
} ];
}
}
- (void) setupGestureRecognizer
{
UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(zoomAction:)];
[pinchGestureRecognizer setDelegate:self];
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)];
[panGestureRecognizer setMinimumNumberOfTouches:1];
[panGestureRecognizer setMaximumNumberOfTouches:1];
[panGestureRecognizer setDelegate:self];
UITapGestureRecognizer *doubleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(DoubleTapAction:)];
[doubleTapGestureRecognizer setDelegate:self];
doubleTapGestureRecognizer.numberOfTapsRequired =2;
// UIRotationGestureRecognizer *rotationGestureRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(RotationAction:)];
// [rotationGestureRecognizer setDelegate:self];
[self addGestureRecognizer:pinchGestureRecognizer];
[self addGestureRecognizer:panGestureRecognizer];
[self addGestureRecognizer:doubleTapGestureRecognizer];
// [self addGestureRecognizer:rotationGestureRecognizer];
}
- (UIImage*) getCroppedImage {
double zoomScale = [[self.imgView.layer valueForKeyPath:@"transform.scale.x"] floatValue];
double rotationZ = [[self.imgView.layer valueForKeyPath:@"transform.rotation.z"] floatValue];
CGPoint cropperViewOrigin = CGPointMake( (_cropperView.frame.origin.x - _imgView.frame.origin.x) *1/zoomScale ,
( _cropperView.frame.origin.y - _imgView.frame.origin.y ) * 1/zoomScale
);
CGSize cropperViewSize = CGSizeMake(_cropperView.frame.size.width * (1/zoomScale) ,_cropperView.frame.size.height * (1/zoomScale));
CGRect CropinView = CGRectMake(cropperViewOrigin.x, cropperViewOrigin.y, cropperViewSize.width , cropperViewSize.height);
CGSize CropinViewSize = CGSizeMake((CropinView.size.width*(1/_imageScale)),(CropinView.size.height*(1/_imageScale)));
if((NSInteger)CropinViewSize.width % 2 == 1)
{
CropinViewSize.width = ceil(CropinViewSize.width);
}
if((NSInteger)CropinViewSize.height % 2 == 1)
{
CropinViewSize.height = ceil(CropinViewSize.height);
}
CGRect CropRectinImage = CGRectMake((NSInteger)(CropinView.origin.x * (1/_imageScale)) ,(NSInteger)( CropinView.origin.y * (1/_imageScale)), (NSInteger)CropinViewSize.width,(NSInteger)CropinViewSize.height);
UIImage *rotInputImage = [[_inputImage ld_fixOrientation] ld_imageRotatedByRadians:rotationZ];
UIImage *newImage = [rotInputImage ld_cropImage:CropRectinImage];
if(newImage.size.width != _realCropsize.width)
{
newImage = [newImage ld_resizedImageToFitInSize:_realCropsize scaleIfSmaller:YES];
}
return newImage;
}
- (BOOL) saveCroppedImage:(NSString *) path {
return [UIImagePNGRepresentation([self getCroppedImage]) writeToFile:path atomically:YES];
}
- (void) actionRotate {
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:0.15 animations:^{
weakSelf.imgView.transform = CGAffineTransformRotate(weakSelf.imgView.transform,-M_PI/2);
if(weakSelf.imgView.frame.size.width < weakSelf.cropperView.frame.size.width || weakSelf.imgView.frame.size.height < weakSelf.cropperView.frame.size.height)
{
double scale = MAX(weakSelf.cropperView.frame.size.width/weakSelf.imgView.frame.size.width,weakSelf.cropperView.frame.size.height/weakSelf.imgView.frame.size.height) + 0.01;
weakSelf.imgView.transform = CGAffineTransformScale(weakSelf.imgView.transform,scale, scale);
}
// 防止越界,上面已经缩小到大小适合了,这里只需要看边界了
[self resizeImageToCenterFit];
}];
}
- (void)actionRestore {
[UIView animateWithDuration:0.2 animations:^{
self.imgView.transform = CGAffineTransformIdentity;
self.imgView.center = self->_cropperView.center;
}];
}
-(void)resizeImageToCenterFit{
CGFloat minX,minY,maxX,maxY,imgViewMaxX,imgViewMaxY;
CGPoint center = self.imgView.center;
minX= CGRectGetMinX(_cropRect);
minY= CGRectGetMinY(_cropRect);
maxX= CGRectGetMaxX(_cropRect);
maxY= CGRectGetMaxY(_cropRect);
imgViewMaxX= center.x + _imgView.frame.size.width/2;
imgViewMaxY= center.y+ _imgView.frame.size.height/2;
if( (center.x - (_imgView.frame.size.width/2) ) >= minX)
{
center.x = minX + (_imgView.frame.size.width/2) ;
}
if( center.y - (_imgView.frame.size.height/2) >= minY)
{
center.y = minY + (_imgView.frame.size.height/2) ;
}
if(imgViewMaxX <= maxX)
{
center.x = maxX - (_imgView.frame.size.width/2);
}
if(imgViewMaxY <= maxY)
{
center.y = maxY - (_imgView.frame.size.height/2);
}
self.imgView.center = center;
}
@end
//
// UIImage+LDScale.h
// HXPictureClippingRotation
//
// Created by aaa on 2024/6/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIImage (LDScale)
- (UIImage *)ld_imageRotatedByRadians:(CGFloat)radians;
- (UIImage *)ld_imageRotatedByDegrees:(CGFloat)degrees;
- (UIImage*)ld_resizedImageToFitInSize:(CGSize)boundingSize scaleIfSmaller:(BOOL)scale;
- (UIImage*)ld_resizedImageToSize:(CGSize)dstSize;
- (UIImage *)ld_cropImage:(CGRect) rect;
- (UIImage *)ld_fixOrientation;
//按比例缩放,size 是你要把图显示到 多大区域 CGSizeMake(300, 140)
-(UIImage *)ld_imageCompressForSize:(UIImage *)sourceImage targetSize:(CGSize)size;
//指定宽度按比例缩放
-(UIImage *)ld_imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth;
@end
NS_ASSUME_NONNULL_END
//
// UIImage+LDScale.m
// HXPictureClippingRotation
//
// Created by aaa on 2024/6/19.
//
#import "UIImage+LDScale.h"
//CGFloat DegreesToRadians(CGFloat degrees);
//CGFloat RadiansToDegrees(CGFloat radians);
@implementation UIImage (LDScale)
- (UIImage *)ld_cropImage:(CGRect) rect{
CGAffineTransform rectTransform;
switch (self.imageOrientation)
{
case UIImageOrientationLeft:
// rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(DegreesToRadians(90)), 0, -self.size.height);
rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation([self ld_degreesToRadians:90]), 0, -self.size.height);
break;
case UIImageOrientationRight:
// rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(DegreesToRadians(-90)), -self.size.width, 0);
rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation([self ld_degreesToRadians:-90]), -self.size.width, 0);
break;
case UIImageOrientationDown:
// rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(DegreesToRadians(-180)), -self.size.width, -self.size.height);
rectTransform = CGAffineTransformTranslate(CGAffineTransformMakeRotation([self ld_degreesToRadians:-180]), -self.size.width, -self.size.height);
break;
default:
rectTransform = CGAffineTransformIdentity;
};
rectTransform = CGAffineTransformScale(rectTransform, self.scale, self.scale);
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], CGRectApplyAffineTransform(rect, rectTransform));
UIImage *result = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation];
CGImageRelease(imageRef);
return result;
}
-(UIImage*)ld_resizedImageToSize:(CGSize)dstSize
{
CGImageRef imgRef = self.CGImage;
// the below values are regardless of orientation : for UIImages from Camera, width>height (landscape)
CGSize srcSize = CGSizeMake(CGImageGetWidth(imgRef), CGImageGetHeight(imgRef)); // not equivalent to self.size (which is dependant on the imageOrientation)!
CGFloat scaleRatio = dstSize.width / srcSize.width;
UIImageOrientation orient = self.imageOrientation;
CGAffineTransform transform = CGAffineTransformIdentity;
switch(orient) {
case UIImageOrientationUp: //EXIF = 1
transform = CGAffineTransformIdentity;
break;
case UIImageOrientationUpMirrored: //EXIF = 2
transform = CGAffineTransformMakeTranslation(srcSize.width, 0.0);
transform = CGAffineTransformScale(transform, -1.0, 1.0);
break;
case UIImageOrientationDown: //EXIF = 3
transform = CGAffineTransformMakeTranslation(srcSize.width, srcSize.height);
transform = CGAffineTransformRotate(transform, M_PI);
break;
case UIImageOrientationDownMirrored: //EXIF = 4
transform = CGAffineTransformMakeTranslation(0.0, srcSize.height);
transform = CGAffineTransformScale(transform, 1.0, -1.0);
break;
case UIImageOrientationLeftMirrored: //EXIF = 5
dstSize = CGSizeMake(dstSize.height, dstSize.width);
transform = CGAffineTransformMakeTranslation(srcSize.height, srcSize.width);
transform = CGAffineTransformScale(transform, -1.0, 1.0);
transform = CGAffineTransformRotate(transform, 3.0 * M_PI_2);
break;
case UIImageOrientationLeft: //EXIF = 6
dstSize = CGSizeMake(dstSize.height, dstSize.width);
transform = CGAffineTransformMakeTranslation(0.0, srcSize.width);
transform = CGAffineTransformRotate(transform, 3.0 * M_PI_2);
break;
case UIImageOrientationRightMirrored: //EXIF = 7
dstSize = CGSizeMake(dstSize.height, dstSize.width);
transform = CGAffineTransformMakeScale(-1.0, 1.0);
transform = CGAffineTransformRotate(transform, M_PI_2);
break;
case UIImageOrientationRight: //EXIF = 8
dstSize = CGSizeMake(dstSize.height, dstSize.width);
transform = CGAffineTransformMakeTranslation(srcSize.height, 0.0);
transform = CGAffineTransformRotate(transform, M_PI_2);
break;
default:
[NSException raise:NSInternalInconsistencyException format:@"Invalid image orientation"];
}
/////////////////////////////////////////////////////////////////////////////
// The actual resize: draw the image on a new context, applying a transform matrix
UIGraphicsBeginImageContextWithOptions(dstSize, NO, 0.0);
CGContextRef context = UIGraphicsGetCurrentContext();
if (orient == UIImageOrientationRight || orient == UIImageOrientationLeft) {
CGContextScaleCTM(context, -scaleRatio, scaleRatio);
CGContextTranslateCTM(context, -srcSize.height, 0);
} else {
CGContextScaleCTM(context, scaleRatio, -scaleRatio);
CGContextTranslateCTM(context, 0, -srcSize.height);
}
CGContextConcatCTM(context, transform);
// we use srcSize (and not dstSize) as the size to specify is in user space (and we use the CTM to apply a scaleRatio)
CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, srcSize.width, srcSize.height), imgRef);
UIImage* resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resizedImage;
}
/////////////////////////////////////////////////////////////////////////////
-(UIImage*)ld_resizedImageToFitInSize:(CGSize)boundingSize scaleIfSmaller:(BOOL)scale
{
// get the image size (independant of imageOrientation)
CGImageRef imgRef = self.CGImage;
CGSize srcSize = CGSizeMake(CGImageGetWidth(imgRef), CGImageGetHeight(imgRef)); // not equivalent to self.size (which depends on the imageOrientation)!
// adjust boundingSize to make it independant on imageOrientation too for farther computations
UIImageOrientation orient = self.imageOrientation;
switch (orient) {
case UIImageOrientationLeft:
case UIImageOrientationRight:
case UIImageOrientationLeftMirrored:
case UIImageOrientationRightMirrored:
boundingSize = CGSizeMake(boundingSize.height, boundingSize.width);
break;
default:
// NOP
break;
}
// Compute the target CGRect in order to keep aspect-ratio
CGSize dstSize;
if ( !scale && (srcSize.width < boundingSize.width) && (srcSize.height < boundingSize.height) ) {
//NSLog(@"Image is smaller, and we asked not to scale it in this case (scaleIfSmaller:NO)");
dstSize = srcSize; // no resize (we could directly return 'self' here, but we draw the image anyway to take image orientation into account)
} else {
CGFloat wRatio = boundingSize.width / srcSize.width;
CGFloat hRatio = boundingSize.height / srcSize.height;
if (wRatio < hRatio) {
//NSLog(@"Width imposed, Height scaled ; ratio = %f",wRatio);
dstSize = CGSizeMake(floorf(srcSize.width * hRatio), boundingSize.height);
} else {
//NSLog(@"Height imposed, Width scaled ; ratio = %f",hRatio);
dstSize = CGSizeMake(boundingSize.width, floorf(srcSize.height * wRatio));
}
}
return [self ld_resizedImageToSize:dstSize];
}
- (UIImage *)ld_imageRotatedByRadians:(CGFloat)radians
{
// return [self ld_imageRotatedByDegrees:RadiansToDegrees(radians)];
return [self ld_imageRotatedByDegrees:[self ld_radiansToDegrees:radians]];
}
- (UIImage *)ld_imageRotatedByDegrees:(CGFloat)degrees
{
// calculate the size of the rotated view's containing box for our drawing space
UIView *rotatedViewBox = [[UIView alloc] initWithFrame:CGRectMake(0,0,self.size.width, self.size.height)];
// CGAffineTransform t = CGAffineTransformMakeRotation(DegreesToRadians(degrees));
CGAffineTransform t = CGAffineTransformMakeRotation([self ld_degreesToRadians:degrees]);
rotatedViewBox.transform = t;
CGSize rotatedSize = rotatedViewBox.frame.size;
// Create the bitmap context
UIGraphicsBeginImageContextWithOptions(rotatedSize, NO, self.scale);
CGContextRef bitmap = UIGraphicsGetCurrentContext();
// Move the origin to the middle of the image so we will rotate and scale around the center.
CGContextTranslateCTM(bitmap, rotatedSize.width/2, rotatedSize.height/2);
// // Rotate the image context
// CGContextRotateCTM(bitmap, DegreesToRadians(degrees));
CGContextRotateCTM(bitmap, [self ld_degreesToRadians:degrees]);
// Now, draw the rotated/scaled image into the context
CGContextScaleCTM(bitmap, 1.0, -1.0);
CGContextDrawImage(bitmap, CGRectMake(-self.size.width / 2, -self.size.height / 2, self.size.width, self.size.height), [self CGImage]);
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
- (UIImage *)ld_fixOrientation {
// No-op if the orientation is already correct
if (self.imageOrientation == UIImageOrientationUp) return self;
// We need to calculate the proper transformation to make the image upright.
// We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored.
CGAffineTransform transform = CGAffineTransformIdentity;
switch (self.imageOrientation) {
case UIImageOrientationDown:
case UIImageOrientationDownMirrored:
transform = CGAffineTransformTranslate(transform, self.size.width, self.size.height);
transform = CGAffineTransformRotate(transform, M_PI);
break;
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
transform = CGAffineTransformTranslate(transform, self.size.width, 0);
transform = CGAffineTransformRotate(transform, M_PI_2);
break;
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
transform = CGAffineTransformTranslate(transform, 0, self.size.height);
transform = CGAffineTransformRotate(transform, -M_PI_2);
break;
case UIImageOrientationUp:
case UIImageOrientationUpMirrored:
break;
}
switch (self.imageOrientation) {
case UIImageOrientationUpMirrored:
case UIImageOrientationDownMirrored:
transform = CGAffineTransformTranslate(transform, self.size.width, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
case UIImageOrientationLeftMirrored:
case UIImageOrientationRightMirrored:
transform = CGAffineTransformTranslate(transform, self.size.height, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
case UIImageOrientationUp:
case UIImageOrientationDown:
case UIImageOrientationLeft:
case UIImageOrientationRight:
break;
}
// Now we draw the underlying CGImage into a new context, applying the transform
// calculated above.
CGContextRef ctx = CGBitmapContextCreate(NULL, self.size.width, self.size.height,
CGImageGetBitsPerComponent(self.CGImage), 0,
CGImageGetColorSpace(self.CGImage),
CGImageGetBitmapInfo(self.CGImage));
CGContextConcatCTM(ctx, transform);
switch (self.imageOrientation) {
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
// Grr...
CGContextDrawImage(ctx, CGRectMake(0,0,self.size.height,self.size.width), self.CGImage);
break;
default:
CGContextDrawImage(ctx, CGRectMake(0,0,self.size.width,self.size.height), self.CGImage);
break;
}
// And now we just create a new UIImage from the drawing context
CGImageRef cgimg = CGBitmapContextCreateImage(ctx);
UIImage *img = [UIImage imageWithCGImage:cgimg];
CGContextRelease(ctx);
CGImageRelease(cgimg);
return img;
}
//按比例缩放,size 是你要把图显示到 多大区域 CGSizeMake(300, 140)
-(UIImage *)ld_imageCompressForSize:(UIImage *)sourceImage targetSize:(CGSize)size{
UIImage *newImage = nil;
CGSize imageSize = sourceImage.size;
CGFloat width = imageSize.width;
CGFloat height = imageSize.height;
CGFloat targetWidth = size.width;
CGFloat targetHeight = size.height;
CGFloat scaleFactor = 0.0;
CGFloat scaledWidth = targetWidth;
CGFloat scaledHeight = targetHeight;
CGPoint thumbnailPoint = CGPointMake(0.0, 0.0);
if(CGSizeEqualToSize(imageSize, size) == NO){
CGFloat widthFactor = targetWidth / width;
CGFloat heightFactor = targetHeight / height;
if(widthFactor > heightFactor){
scaleFactor = widthFactor;
}
else{
scaleFactor = heightFactor;
}
scaledWidth = width * scaleFactor;
scaledHeight = height * scaleFactor;
if(widthFactor > heightFactor){
thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
}else if(widthFactor < heightFactor){
thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
}
}
UIGraphicsBeginImageContext(size);
CGRect thumbnailRect = CGRectZero;
thumbnailRect.origin = thumbnailPoint;
thumbnailRect.size.width = scaledWidth;
thumbnailRect.size.height = scaledHeight;
[sourceImage drawInRect:thumbnailRect];
newImage = UIGraphicsGetImageFromCurrentImageContext();
if(newImage == nil){
NSLog(@"scale image fail");
}
UIGraphicsEndImageContext();
return newImage;
}
//指定宽度按比例缩放
-(UIImage *)ld_imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth{
UIImage *newImage = nil;
CGSize imageSize = sourceImage.size;
CGFloat width = imageSize.width;
CGFloat height = imageSize.height;
CGFloat targetWidth = defineWidth;
CGFloat targetHeight = height / (width / targetWidth);
CGSize size = CGSizeMake(targetWidth, targetHeight);
CGFloat scaleFactor = 0.0;
CGFloat scaledWidth = targetWidth;
CGFloat scaledHeight = targetHeight;
CGPoint thumbnailPoint = CGPointMake(0.0, 0.0);
if(CGSizeEqualToSize(imageSize, size) == NO){
CGFloat widthFactor = targetWidth / width;
CGFloat heightFactor = targetHeight / height;
if(widthFactor > heightFactor){
scaleFactor = widthFactor;
}
else{
scaleFactor = heightFactor;
}
scaledWidth = width * scaleFactor;
scaledHeight = height * scaleFactor;
if(widthFactor > heightFactor){
thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
}else if(widthFactor < heightFactor){
thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
}
}
UIGraphicsBeginImageContext(size);
CGRect thumbnailRect = CGRectZero;
thumbnailRect.origin = thumbnailPoint;
thumbnailRect.size.width = scaledWidth;
thumbnailRect.size.height = scaledHeight;
[sourceImage drawInRect:thumbnailRect];
newImage = UIGraphicsGetImageFromCurrentImageContext();
if(newImage == nil){
NSLog(@"scale image fail");
}
UIGraphicsEndImageContext();
return newImage;
}
-(CGFloat)ld_degreesToRadians:(CGFloat)degrees{
return degrees * M_PI / 180;
}
-(CGFloat)ld_radiansToDegrees:(CGFloat)radians{
return radians * 180/M_PI;
}
@end
//#ifdef __has_include
// #if __has_include(<YYKit/YYKit.h>)
//
// #else
// CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
// CGFloat RadiansToDegrees(CGFloat radians) {return radians * 180/M_PI;};
// #endif
//#endif
......@@ -14,13 +14,14 @@
#import "FUSAlertView.h"
#import "FUSDialogView.h"
#import "VPImageCropperViewController.h"
//#import "VPImageCropperViewController.h"
#import "FUSRotationCropperImageViewController.h"
#import "FUSToolSet.h"
// 定义回调
typedef void(^Block)(BOOL isSuccess, UIImage *image);
@interface FUSSelectImageView ()<SLActionSheetProtocol, UINavigationControllerDelegate, UIImagePickerControllerDelegate, VPImageCropperDelegate>
@interface FUSSelectImageView ()<SLActionSheetProtocol, UINavigationControllerDelegate, UIImagePickerControllerDelegate, FUSRotationCropperImageDelegate>
@end
......@@ -361,11 +362,15 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
UIImage *originImage = [info objectForKey:UIImagePickerControllerOriginalImage];
if (mIsEditing) {
VPImageCropperViewController *imageCropVC = [[VPImageCropperViewController alloc] initWithImage:originImage cropFrame:CGRectMake(0, (UIView.fus_screenH - UIView.fus_screenW) / 2.0, UIView.fus_screenW, UIView.fus_screenW) limitScaleRatio:3.0];
// VPImageCropperViewController *imageCropVC = [[VPImageCropperViewController alloc] initWithImage:originImage cropFrame:CGRectMake(0, (UIView.fus_screenH - UIView.fus_screenW) / 2.0, UIView.fus_screenW, UIView.fus_screenW) limitScaleRatio:3.0];
// imageCropVC.delegate = self;
// [mViewCtrl presentViewController:imageCropVC
// animated:YES
// completion:nil];
FUSRotationCropperImageViewController *imageCropVC = [[FUSRotationCropperImageViewController alloc] initWithImage:originImage maxScaleRatio:3.0];
imageCropVC.delegate = self;
[mViewCtrl presentViewController:imageCropVC
animated:YES
completion:nil];
[mViewCtrl presentModalViewController:imageCropVC animated:YES];
return;
}
......@@ -391,9 +396,9 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
if (mBlock) mBlock(NO, nil);
}
- (void)imageCropper:(VPImageCropperViewController *)cropperViewController didFinished:(UIImage *)editedImage
{
[cropperViewController dismissViewControllerAnimated:YES completion:nil];
#pragma mark --- FUSRotationCropperImageDelegate
- (void)fus_imageCropper:(FUSRotationCropperImageViewController *)controller didFinished:(UIImage *)editedImage{
[controller dismissViewControllerAnimated:YES completion:nil];
// 回调选择的图片
if (editedImage) {
if (mBlock) mBlock(YES, editedImage);
......@@ -401,13 +406,28 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
if (mBlock) mBlock(NO, nil);
}
}
- (void)imageCropperDidCancel:(VPImageCropperViewController *)cropperViewController
{
[cropperViewController dismissViewControllerAnimated:YES completion:nil];
- (void)fus_imageCropperDidCancel:(FUSRotationCropperImageViewController *)controller{
[controller dismissViewControllerAnimated:YES completion:nil];
if (mBlock) mBlock(NO, nil);
}
//- (void)imageCropper:(VPImageCropperViewController *)cropperViewController didFinished:(UIImage *)editedImage
//{
// [cropperViewController dismissViewControllerAnimated:YES completion:nil];
// // 回调选择的图片
// if (editedImage) {
// if (mBlock) mBlock(YES, editedImage);
// }else{
// if (mBlock) mBlock(NO, nil);
// }
//}
//
//- (void)imageCropperDidCancel:(VPImageCropperViewController *)cropperViewController
//{
// [cropperViewController dismissViewControllerAnimated:YES completion:nil];
// if (mBlock) mBlock(NO, nil);
//}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
......
......@@ -82,6 +82,7 @@ PODS:
- HWPanModal
- libPhoneNumber-iOS (~> 0.8)
- LineSDK (~> 4.0.2)
- Masonry
- MBProgressHUD (~> 1.0.0)
- MJRefresh (= 3.1.17)
- mob_sharesdk
......@@ -333,7 +334,7 @@ SPEC CHECKSUMS:
FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a
FUSFoundation: 72ea08ed83ac942bed450ca9e7bbe6cc5aba5ffd
FUSFoundation: 422f1d85836309ff2568fa354e3db49ebc5fd766
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
GoogleAppMeasurement: 6b6a08fd9c71f4dbc89e0e812acca81d797aa342
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
......
......@@ -124,6 +124,9 @@
],
"HWPanModal": [
],
"Masonry": [
]
},
"swift_version": "5.0"
......
......@@ -82,6 +82,7 @@ PODS:
- HWPanModal
- libPhoneNumber-iOS (~> 0.8)
- LineSDK (~> 4.0.2)
- Masonry
- MBProgressHUD (~> 1.0.0)
- MJRefresh (= 3.1.17)
- mob_sharesdk
......@@ -333,7 +334,7 @@ SPEC CHECKSUMS:
FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a
FUSFoundation: 72ea08ed83ac942bed450ca9e7bbe6cc5aba5ffd
FUSFoundation: 422f1d85836309ff2568fa354e3db49ebc5fd766
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
GoogleAppMeasurement: 6b6a08fd9c71f4dbc89e0e812acca81d797aa342
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -156,6 +156,9 @@
#import "FUSProgressLoadingView.h"
#import "FUSProgressView.h"
#import "FUSRecordingAnimationView.h"
#import "FUSRotationCropperImageViewController.h"
#import "LDImageCropperView.h"
#import "UIImage+LDScale.h"
#import "FUSRoundRectLabel.h"
#import "FUSSelectImageView.h"
#import "FUSStrokeShadowLabel.h"
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FUSFoundation
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/CocoaAsyncSocket" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/HWPanModal" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/RMStore" "${PODS_CONFIGURATION_BUILD_DIR}/TalkingData" "${PODS_CONFIGURATION_BUILD_DIR}/UIImage+BlurredFrame" "${PODS_CONFIGURATION_BUILD_DIR}/YYKit" "${PODS_CONFIGURATION_BUILD_DIR}/ZipArchive" "${PODS_CONFIGURATION_BUILD_DIR}/libPhoneNumber-iOS" "${PODS_ROOT}/FacebookSDK" "${PODS_ROOT}/GoogleSignIn/Frameworks" "${PODS_ROOT}/LineSDK/LineSDK" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/TwitterKit5/iOS" "${PODS_ROOT}/YYKit/Vendor" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_XCFRAMEWORKS_BUILD_DIR}/MOBFoundation"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/CocoaAsyncSocket" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/HWPanModal" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/RMStore" "${PODS_CONFIGURATION_BUILD_DIR}/TalkingData" "${PODS_CONFIGURATION_BUILD_DIR}/UIImage+BlurredFrame" "${PODS_CONFIGURATION_BUILD_DIR}/YYKit" "${PODS_CONFIGURATION_BUILD_DIR}/ZipArchive" "${PODS_CONFIGURATION_BUILD_DIR}/libPhoneNumber-iOS" "${PODS_ROOT}/FacebookSDK" "${PODS_ROOT}/GoogleSignIn/Frameworks" "${PODS_ROOT}/LineSDK/LineSDK" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/TwitterKit5/iOS" "${PODS_ROOT}/YYKit/Vendor" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_XCFRAMEWORKS_BUILD_DIR}/MOBFoundation"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public"
PODS_BUILD_DIR = ${BUILD_DIR}
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FUSFoundation
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/CocoaAsyncSocket" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/HWPanModal" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/RMStore" "${PODS_CONFIGURATION_BUILD_DIR}/TalkingData" "${PODS_CONFIGURATION_BUILD_DIR}/UIImage+BlurredFrame" "${PODS_CONFIGURATION_BUILD_DIR}/YYKit" "${PODS_CONFIGURATION_BUILD_DIR}/ZipArchive" "${PODS_CONFIGURATION_BUILD_DIR}/libPhoneNumber-iOS" "${PODS_ROOT}/FacebookSDK" "${PODS_ROOT}/GoogleSignIn/Frameworks" "${PODS_ROOT}/LineSDK/LineSDK" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/TwitterKit5/iOS" "${PODS_ROOT}/YYKit/Vendor" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_XCFRAMEWORKS_BUILD_DIR}/MOBFoundation"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/AppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/CocoaAsyncSocket" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth" "${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher" "${PODS_CONFIGURATION_BUILD_DIR}/HWPanModal" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/RMStore" "${PODS_CONFIGURATION_BUILD_DIR}/TalkingData" "${PODS_CONFIGURATION_BUILD_DIR}/UIImage+BlurredFrame" "${PODS_CONFIGURATION_BUILD_DIR}/YYKit" "${PODS_CONFIGURATION_BUILD_DIR}/ZipArchive" "${PODS_CONFIGURATION_BUILD_DIR}/libPhoneNumber-iOS" "${PODS_ROOT}/FacebookSDK" "${PODS_ROOT}/GoogleSignIn/Frameworks" "${PODS_ROOT}/LineSDK/LineSDK" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/TwitterCore/iOS" "${PODS_ROOT}/TwitterKit5/iOS" "${PODS_ROOT}/YYKit/Vendor" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_XCFRAMEWORKS_BUILD_DIR}/MOBFoundation"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public"
PODS_BUILD_DIR = ${BUILD_DIR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment