ios8 - UIPresentationController changes size when another view controller is displayed on top of it -


i presenting modal view controller using uipresentationcontroller. setting frame of presentedview less containview's bounds using following method:

override func frameofpresentedviewincontainerview() -> cgrect {     let mydx = (self.containerview!.bounds.width - 600)/2     let mydy = (self.containerview!.bounds.height - 600)/2     return self.containerview!.bounds.insetby(dx: mydx, dy: mydy) } 

everything works great unto point.

now, present view controller modally (default not custom) on top of displayed modal view controller takes entire screen. so, have custom modal view controller underneath default modal view controller covers entire screen.

the problem when dismiss top view controller thats covering entire screen, custom view controller shows covering entire screen well. want custom view controller's size remain same (smaller containerview). there way can achieve this.

any appreciated

i encountered same issue. couldn't solve adding constraints, , -[uipresentationcontroller containerviewwilllayoutsubviews] called late (after dismiss animation completed).

after time figured out problem seems presenting controller view being removed view hierarchy when present default full screen presentation style , added again full screen size when has shown again.

in ios 8, use uimodalpresentationoverfullscreen presentationstyle when presenting smaller controller. system not automatically remove presenting controller's view then. (-[uiviewcontroller viewwilldisappear:] , such, doesn't called on presenting controller when though)

you use uimodalpresentationcustom available in ios 7, you'll have provide own transition animation.


Comments