1.效果图
2.代码实现
// 在storyboard上给imageView添加拖拽手势
// 监听手势事件
- (IBAction)pan:(UIPanGestureRecognizer *)sender {
// 获取当前位置
CGPoint curP = [sender locationInView:self.iv];
// 计算擦除的frame
CGFloat wh = 30;
CGFloat x = curP.x - wh * 0.5;