I would like to use one view controller for both an iPhone view and an iPad PopOverView. If the view is displayed in a popover, I would like to do some minor reformatting of the UI.
Is it possible for my UIViewController to detect whether it is being displayed in a UIPopoverController?
I've found the contentSizeForViewInPopover property, which is great for resizing the view, but I would like to remove/hide an element if the view is loaded in a PopOverView.
I do not think it is possible. I've tried looking at the class of the parentViewController, as well as the class of the presentingViewController, and both are null. Without them providing a property on UIViewController similar to the navigationController property, it can't be done.
you can override below method in your class and manage it with BOOL variable or some functions
- (CGSize)contentSizeForViewInPopover
{
popovermode = YES;
[self callhideMethod];
return CGSizeMake(320, 200);
}
it might help you.
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