UITapGestureRecognizer on a text field not as expected

前端 未结 2 1095
孤街浪徒
孤街浪徒 2021-01-22 11:50

In my class I have 11 UITapGestureRecognizers in an array textViewRecognizer attached to 11 out of 100 UITextFields in an array boxArray. When a Textfield is tapped containing a

2条回答
  •  不要未来只要你来
    2021-01-22 12:21

    I would add a Tag to my UITextView and set the UITextViewDelegate to my ViewController.

    Then I would add the following Delegate method:

    func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
        print("Textview tag: ", textView.tag)
        return false
    }
    

提交回复
热议问题