Keywords: iOS 13 | Modal View Controller | FullScreen Presentation
Abstract: This article provides an in-depth analysis of the new default card-style presentation behavior for modal view controllers in iOS 13. It details how to achieve full-screen modal presentation through both code and Storyboard configurations. Starting from the WWDC 2019 Platforms State of the Union updates, the article systematically explains the usage of the modalPresentationStyle property and offers complete code examples and interface configuration guidelines to help developers quickly adapt to iOS 13's interface presentation changes.
Changes in Modal Presentation Behavior in iOS 13
In iOS 13, Apple introduced significant updates to the presentation style of modal view controllers. According to the official announcement in the WWDC 2019 Platforms State of the Union, the system now defaults to a new card-style presentation. This change means that modal view controllers no longer appear in full-screen by default, instead adopting a new interaction pattern where users can quickly dismiss the presented view controller with a downward swipe gesture.
Technical Implementation of Full-Screen Presentation
To restore the traditional full-screen presentation effect, developers need to explicitly specify the modal presentation style. At the code level, this can be achieved by setting the modalPresentationStyle property:
let viewController = UIViewController()
viewController.modalPresentationStyle = .fullScreen
self.present(viewController, animated: true, completion: nil)
The above code creates a new view controller instance and sets its modal presentation style to full-screen mode. The .fullScreen option forces the view controller to cover the entire screen in the traditional manner, while the .overFullScreen option allows underlying content to remain visible during presentation, suitable for scenarios requiring transparency effects.
Storyboard Configuration Method
For scenarios using Storyboard for interface development, full-screen presentation can also be achieved. In Interface Builder, specific properties need to be set for the segue: first set the segue's kind property to "Present Modally", then set the Presentation property to "Full Screen". This configuration ensures that modal transitions triggered from Storyboard will display in full-screen format.
Technical Detail Analysis
This change in iOS 13 reflects Apple's evolving approach to user experience design. The new card-style presentation not only provides more intuitive dismissal interactions but also maintains visual hierarchy. However, full-screen presentation remains necessary for certain business scenarios, such as advertisement displays, login interfaces, or user flows requiring complete focus.
It's worth noting that this change also affects the compatibility of third-party libraries and plugins. As mentioned in the reference article, the issue where AdMob full-screen ads don't completely cover the screen on iOS 13 devices is precisely due to the new default presentation behavior. Developers need to ensure timely updates to relevant configurations to maintain application functionality integrity.
Best Practice Recommendations
In practical development, it's recommended to choose the appropriate presentation method based on specific business requirements. For interfaces requiring complete user focus, such as payment processes or content creation scenarios, full-screen presentation remains the preferred solution. For auxiliary information displays or quick operation interfaces, the new card-style presentation may offer better user experience.
Additionally, developers should pay attention to backward compatibility. Although iOS 13 introduced new default behaviors, the previous full-screen presentation methods remain fully supported, ensuring the stable operation of existing code.