kevin-lyn / STPopup

STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.
MIT License
2.6k stars 345 forks source link

How use it for full screen presentation? #20

Closed popei69 closed 9 years ago

popei69 commented 9 years ago

Hi guys,

The main goal is to present my first viewController looking like a "classic" modal, and detail controllers pushed inside will be smaller.

I tried to set contentSizeInPopup with UIScreen bounds dimension and set transition with a full screen presentation, but it didn't work.

Is there anyway to do that in a proper way?

Thanks, Ben

kevin-lyn commented 9 years ago

Hi, if you are going to present the view controller as a normal modal, just use "presentViewController" provided by UIViewController, instead of using STPopupController. contentSizeInPopup will only work if the view controller is pushed into a popup controller.

popei69 commented 9 years ago

Hi kevin, thanks for your quick answer. I already tried that, but as I said, I need details controllers with smaller sizes, and as I started with STPopupController, I can't really reimplement a use case only for make it full screen. Best behaviour was to set contentSizeInPopup with maximum height minus navigationbar height.

kevin-lyn commented 9 years ago

@popei69 why do you need to reimplement it? you can make one view controller as both popup and normal view controller.

popei69 commented 9 years ago

@kevin0571 I would like to optimise screen view depending of the device dimension (iphone4s vs iPad). On (really) small device, I will choose full screen, and not for bigger one. I wanted to keep same code as far as I can, but seems STPopup cannot "fake" a classic modal presentation in full screen. Thanks anyway.