title: how to add gesture recognizer to UI Label?
body: <p><a href="https://i.stack.imgur.com/csObe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/csObe.png" alt="enter image description here"></a></p>
  
  <p>I am trying to add tap gesture to the February label like the picture above, but I don't know why when I add gesture recognizer to the UI Label, it doesn't work, but if I assign that tap gesture to the view (the blue box) , it worked as I am expected.</p>
  
  <p>can we actually add gesture recognizer to UI Label? or what should I do to add gesture to the UI label?</p>
  
  <pre><code>class AttendanceListVC: UIViewController {
  
      @IBOutlet weak var dummyView: UIView!
      @IBOutlet weak var monthLabel: UILabel!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
  
          prepareTapGestureToChooseMonth()
  
  
      }
  
  }
  
  
  
      func prepareTapGestureToChooseMonth() {
          let tapGesture = UITapGestureRecognizer(target: self, action: #selector(AttendanceListVC.tapFunction(sender:)))
          tapGesture.numberOfTapsRequired = 1
  
  
          monthLabel.addGestureRecognizer(tapGesture)
          dummyView.addGestureRecognizer(tapGesture)
      }
  
      @objc func tapFunction(sender: UITapGestureRecognizer) {
  
  
         // show pop up
  
      }
  
  
  }
  </code></pre>