gran33
gran33

Reputation: 12981

Custom Delegate for a custom View

I m using Xamarin for iOS and I have a custom View which inherit from UIView. I would like to add a custom delegate to that view.

So far I found that: Delegate (not useful) example

I want my delegate to be on his own and won't inherit from any other known delegate.

Upvotes: 2

Views: 494

Answers (1)

poupou
poupou

Reputation: 43553

There is no delegate property on UIView (see Apple docs). It does exists in some subclasses, like UITextView (and other types).

What you can do (beside using the base classes provided) is:

  1. (with the unified API) create your own classes that implements the IUITextViewDelegate interface and assign it to the Delegate property;

  2. Create any class that conforms to the delegate (i.e. minimally all required members), add the required [Export], and assign it to the WeakDelegate property.

Upvotes: 1

Related Questions