I just wanted to clarify some of the confusion that I have with a delegate template that needs to be built when there are several UIViews and Subviews of these views. To make it clear, let him define some variables.
Define these objects as:
- ViewController
A - Uiview
B - Subview
C
Now I understand how the delegation pattern works (I think), although I'm not sure how to implement this pattern in nested UIViews. Some questions I have:
Should a Cdelegate implemented using superview ( B) be included ?
And if so, should Bpass this information to the ViewController ( A) delegate ?
Here, the script, let it Chave a UITextView, this text display height is determined by the line received from the API service. Bdoes not have access to the API, because this task must be done through ViewController ( A).
If Cthen contains a delegate that points to:
- Delegate ViewController (
A) implementation ? - UIView (
B) delegate implementation ? - Other?
If the answer is (2), then should Bthen call ViewController ( A) and pass this information through the event chain?
Here is a little visual:
A <IBDelegate><--- B <ICDelegate><--- CcallsDelegate.OnApiComplete(float height);
What is the "delegate" in this case? ( ICDelegateor IBDelegate). And what is the chain of events?
, UIView, .
, UIViews, , - .
, . .