user3676403
user3676403

Reputation: 25

UILabel in UIscrollView does not recognize UISwipegesture

code:
lblQuestion = [[UILabel alloc]initWithFrame:CGRectMake(23, intQuesPos, 280, 100)];
    lblQuestion.numberOfLines = 0;
    UISwipeGestureRecognizer *topGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeToptoBottom)];
    [topGesture setDirection:UISwipeGestureRecognizerDirectionDown];
    [lblQuestion addGestureRecognizer:topGesture];
    [scrollQuestion addSubview:lblQuestion];
    [vwQuestion addSubview:scrollQuestion];

I have UILabel in UIScrollView and I added UISwipegesture to UILabel. When I swipe down the UISCrollView only detected.

Any help will be appreciated.

Thanks in advance

Upvotes: 1

Views: 74

Answers (1)

Sunny Shah
Sunny Shah

Reputation: 13020

Make userInteractionEnabled true for the lable

    lblQuestion.userInteractionEnabled=YES;

Upvotes: 1

Related Questions