Some answers say that Get to UIViewController from UIView? is a bad design practice.
But, LevelView
, from Apple's very own BubbleLevel Xcode example project, has an assign property to its viewController
.
I think the best thing to do is to define a protocol & assign the view controller as the delegate of the view, like you would do with a UITableView
or a UITextField
or UITextView
.
But, I could be wrong, so my question is what is the recommended way for a view to communicate with its view controller?