Zohaib Brohi
Zohaib Brohi

Reputation: 574

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?

Upvotes: 5

Views: 7200

Answers (3)

Deepak
Deepak

Reputation: 734

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

Upvotes: 1

Pratik Sodha
Pratik Sodha

Reputation: 3727

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

Upvotes: 1

Shreeram Bhat
Shreeram Bhat

Reputation: 3157

  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.

Upvotes: 10

Related Questions