18

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.

shim
  • 9,289
  • 12
  • 69
  • 108
user3247895
  • 473
  • 1
  • 6
  • 14
  • 1
    There is one more difference. in case of .fullScreen, viewWillDisappear for presentingVC is called, whereas in case of .overFullScreen, viewWillDisappear is not called. – user3247895 Nov 03 '19 at 07:50

2 Answers2

23

.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.

shim
  • 9,289
  • 12
  • 69
  • 108
Suraj Lokhande
  • 323
  • 1
  • 2
  • 11
  • 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 .fullScreen – user3247895 Nov 03 '19 at 05:41
2

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

Ten
  • 1,426
  • 1
  • 14
  • 18
  • 2
    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. – B Roy Dawson Sep 16 '21 at 22:57