Benefit of using .fullScreen presentation style in compare to .overFullScreen presentation style in ios
Asked Answered
S

2

19

I am curious to know that what is/are the actual benefit(s) (with some example) we get if we use .fullScreen versus .overFullScreen presentation style while presenting a view controller modally over rootViewController in an iOS app.

I read using .overFullScreen will unnecessarily show the content below it if presentedViewController has transparency, but if I use .fullScreen then also there will be a grey screen visible behind transparency which won't look good. So I am not sure how this is beneficial.

Silkaline answered 1/11, 2019 at 10:41 Comment(1)
There is one more difference. in case of .fullScreen, viewWillDisappear for presentingVC is called, whereas in case of .overFullScreen, viewWillDisappear is not called.Silkaline
X
26

.fullScreen: the views belonging to the presenting view controller are removed after the presentation completes.

.overFullScreen: the view beneath the presented are not removed from the view hierarchy when the presentation finishes. So if the presented view controller does not fill the screen with opaque content, the underlying content shows through.

This is the actual difference between them. I hope it will help you.

Xylography answered 1/11, 2019 at 11:17 Comment(1)
If i present view controller does not fill the screen with opaque content with .fullScreen, what will be visible behind transparent area? i think grey color will be visible. With grey color it won't look good, then why to use .fullScreenSilkaline
D
3

when back .fullScreen will call viewDidAppear .overFullScreen won't call it.

Dobb answered 17/5, 2021 at 9:19 Comment(1)
The reason viewDidAppear is not called when dismissing a view controller that was presented with .overFullScreen is because the presenting controller could have still been visible if the presented view controller is partially transparent as noted by @Saraj Lokhande.Katzenjammer

© 2022 - 2024 — McMap. All rights reserved.