I'm having a hard time getting my head around custom delegation - I would be most grateful if someone could help me:
I have a UIViewController with a tab bar controller, and each of these contains a subclassed UIView. In one of the views, I have a UIButton in which I want to load a UIDocumentInteractionController. I already have the code to do this second part, as the document controller needs access to a UIViewController in order to get pushed to the stack.
But how can my UIView get access to the UIViewController?
I've read a plethora of things on SO tonight, such as:
- It can't be done
- Set the UIViewController as a property of the UIView so it knows which it belongs to
- Calling nextResponder on the UIViewController
- Delegation
I can happily hit my -(void)buttonPressed: (id)sender
method, but where should it go from here to implement delegation? Should it just fire something like [delegate documentRequested: sender]
assuming this method exists in my view controller?
Thanks in advance for any assistance.