Reputation: 25
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
Reputation: 13020
Make userInteractionEnabled true for the lable
lblQuestion.userInteractionEnabled=YES;
Upvotes: 1