UITapGestureRecognizer not working in UIImageView

前端 未结 9 1544
长发绾君心
长发绾君心 2021-01-03 18:16

I had the following code:

UITapGestureRecognizer *showStoryTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showNewsStory         


        
9条回答
  •  被撕碎了的回忆
    2021-01-03 19:06

    You should enable user interaction for UIImageView object:

    [self.storyImageView_ setUserInteractionEnabled:YES];
    

    EDIT:

    Try to remove the

    [showStoryTapRecognizer setDelegate:self];
    

    I don't think UITapGestureRecognizer has its delegate methods as far as I know.

提交回复
热议问题