当前位置: 代码迷 >> 综合 >> iOS轻扫手势(Swipe)
  详细解决方案

iOS轻扫手势(Swipe)

热度:9   发布时间:2024-01-20 19:27:19.0

//抽象类 特点 不能创建对象

    UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewroSwipe:)];

    swipe.delegate = self;

    //往右或往左轻扫

    swipe.direction = UISwipeGestureRecognizerDirectionUp;//向上

    swipe1.direction = UISwipeGestureRecognizerDirectionDown;//向下

    swipe1.numberOfTouchesRequired = 1;

  

    //手势View 对象 添加给UIImageView

    [self.imgView addGestureRecognizer:swipe];




转载请注明出处:http://blog.csdn.net/sevenquan