Is it possible to quickly present a UIView
in a UIPopoverController
without having a UIViewController
managing the UIView
?
Currently I have a "DelegateViewController
" that gets my view passed. Then I use that controller for presentation. But I'm wondering if there is an easier way?
If you have a UIView
, then you can easily create a plain UIViewController
as a container.
UIViewController* controller = [[[UIViewController alloc] init] autorelease];
controller.view = myView;
Is it possible to quickly present a UIView in a UIPopoverController without having a UIViewController managing the UIView?
No. UIPopoverController manages a view controller, not a view. When you create a popover controller, you have to provide the view controller that will manage the content. That doesn't mean that you have to create a special view controller subclass in every place where you use a popover -- as bendytree points out, you can use a plain old UIViewController if you want. But you can't just pass UIPopoverController a view -- it has no way to accept it, and wouldn't know what to do with it if did.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With