Can we Add Tap Gesture to UILabel?

后端 未结 1 1903
日久生厌
日久生厌 2021-01-29 12:08

I have added Label in the UIView and created its outlet, then with the help of UITapGestureRecognizer i have added the functionality,but when i tap or click in the label. Label

1条回答
  •  离开以前
    2021-01-29 12:51

    Yes you can, but you need to set the label's isUserInteractionEnabled flag to true

    0 讨论(0)
提交回复
热议问题