我们在做一些有图片的项目中,经常需要添加用户长按保存图片的功能,本人自己整理了一些方法如下:
// 长按保存图片
// 添加手势
UILongPressGestureRecognizer *longP = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longP)];
imageView.userInteractionEnabled = YES; // 打开交互
[imageView addGestureRecognizer:longP];
- (void)longP{
UIAlertController *con = [UIAlertController alertControllerWithTitle