How do you connect the “delegate” outlet of a UITextView to a class that implements UITextViewDelegate protocol?

后端 未结 3 1393
耶瑟儿~
耶瑟儿~ 2021-01-05 03:38

How do you connect the \"delegate\" outlet of a UITextView to a class that implements UITextViewDelegate protocol?

I can\'t seem to find an example in the docs

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-05 04:25

    If you mean "how do I make an object that is created with code the delegate for my text view", just set the delegate property (this is what dragging in Interface Builder will do for you):

    textView.delegate = yourDelegateObject;
    

提交回复
热议问题