Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the modal presentation style "over current context" and "over fullscreen"?

Tags:

xcode

ios

I wonder what the difference between current context and over fullscreen is?

When I switch between them I don't see any changes in my app. All the animations look the same etc.

like image 238
user2636197 Avatar asked Nov 21 '25 07:11

user2636197


2 Answers

There aren't any visual differences if you are presenting a view controller from a view controller that is already in full screen mode. However, if the presenting view controller isn't in full screen mode, the current context will make a different. For example:

  • Left: before present, the current view controller is not in full screen mode
  • Middle: presenting a new view controller with full screen
  • Right: presenting a new view controller with current context

A full list of comparison of different presentation mode available here on Github.

like image 76
Yuchen Avatar answered Nov 22 '25 20:11

Yuchen


fullScreen:
The presented view covers the screen (fullscreen).

currentContext:
The UIModalPresentationCurrentContext style covers a specific view controller in your interface. When using the contextual style, you designate which view controller you want to cover by setting its definesPresentationContext property to true.

When presenting a view controller using the UIModalPresentationFullScreen style, UIKit normally removes the views of the underlying view controller after the transition animations finish. You can prevent the removal of those views by specifying the UIModalPresentationOverCurrentContext style instead. You might use that style when the presented view controller has transparent areas that let underlying content show through.

Read more about presenting viewControllers here.

like image 40
Rashwan L Avatar answered Nov 22 '25 21:11

Rashwan L



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!