Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

modalPresentationStyle default value in iOS 13

As per apple documentation,

The default value for this property is UIModalPresentationStyle.automatic

In iOS 12, the default value was UIModalPresentationStyle.fullScreen, and that what I get.

But when I am running my app on iOS 13 I am getting .pageSheet as navigationController.modalPresentationStyle

Is there anything I am doing wrong or the default value is .pageSheet?

like image 854
Zohaib Brohi Avatar asked Sep 30 '19 09:09

Zohaib Brohi


People also ask

What is the default Modalpresentationstyle?

The default value for this property is UIModalPresentationStyle.automatic.


3 Answers

  1. UIModalPresentationStyle.automatic switches between .pageSheet and .fullScreen depending on the context in which UIViewController is presented.
  2. If you are using normal UIViewController it will default to .pageSheet.
  3. But if you are using some subclass of UIViewController like UIImagePickerController iOS expects content should in full screen mode so it will default to .fullscreen.
  4. If you are using iOS version less than 13 it will always default to .fullscreen.
like image 125
Shreeram Bhat Avatar answered Oct 08 '22 14:10

Shreeram Bhat


The default presentation style chosen by the system. It's UIModalPresentationAutomatic

Automatic means if we using UIImagePickerController and sourceType .photoLibrary then it's present as cascade view. And sourceType .camera then it's present in full screen.

https://developer.apple.com/videos/play/wwdc2019/224/

https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationpagesheet?language=objc

like image 45
Pratik Sodha Avatar answered Oct 08 '22 13:10

Pratik Sodha


Presentation style is Automatic which defaults to pagesheet in iOS 13 when you present a viewcontroller modally

like image 1
Deepak Avatar answered Oct 08 '22 13:10

Deepak