Gesture recognizer (swipe) on UIImageView

后端 未结 6 2084
栀梦
栀梦 2020-12-14 06:19

I am trying to NSLog when I swipe over an UIImageView with this code, but it does not work for some reason. Any idea ?

@implementation ViewController

- (voi         


        
6条回答
  •  星月不相逢
    2020-12-14 07:06

    Different than other UIViews, UIImageView, as default, comes with user interaction disabled. Include this line in your code and the gesture should work as expected:

    imageView.userInteractionEnabled = YES;
    

提交回复
热议问题