#import “HandleImageView.h”
#import “UIImage+Tool.h”
@interface HandleImageView()
@property (nonatomic,weak) UIImageView *imageView;
@end
@implementation HandleImageView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
//添加UIImageView
[self addImageView];
//添加手势
[self addGestureRecognizers];
}
return self;
}
-(void)addGestureRecognizers
{
//1.长按
UILongPressGestureRecognizer *longPress=[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPress:)];
[_imageView addGestureRecognizer:longPress];
[self addPinch];
[self addRotation];
}
//长按方法
-(void)longPress:(UILongPressGestureRecognizer *)longPress
{
if(longPress.state==