I want to bring up a UIView
on top of another UIView
. I want to do this in a way such that the child view will have its own UIViewController
. Is this possible?
So I should be able to add a button to the child view:
UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
...
[closeButton addTarget:self action:@selector(closeMe) forControlEvents:UIControlEventTouchUpInside];
closeMe
being a method in the child view's ViewController.
In my test code, when the user taps the close button, it crashes with an undefined selector because the parent view's ViewController has no closeMe
method.
Edit:
Sorry, I mentioned the closeMe
method only as an example. There are many other methods I need to support with this child view (e.g. handle view rotations), and my goal of the child view having its own ViewController is to encapsulate.