modalPresentationStyle default value in iOS 13
Asked Answered
P

3

5

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?

Petronilapetronilla answered 30/9, 2019 at 9:30 Comment(0)
A
10
  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.
Arvy answered 30/9, 2019 at 10:0 Comment(0)
E
1

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

Edwardoedwards answered 30/9, 2019 at 9:57 Comment(0)
I
1

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

Incredible answered 30/9, 2019 at 10:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.