SkillAgentSearch skills...

DVVFixModalPresentationStyle

解决在 Xcode 11 以及 iOS 13 上 UIViewController 的 modalPresentationStyle 值变成了 UIModalPresentationPageSheet,而不是默认的 UIModalPresentationFullScreen,导致之前通过 presentViewController:animated:completion: 方法弹出的控制器效果非全屏的问题

Install / Use

/learn @devdawei/DVVFixModalPresentationStyle
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DVVFixModalPresentationStyle

解决在 iOS 13 上 UIViewController 的 modalPresentationStyle 值变成了 UIModalPresentationPageSheet,而不是默认的 UIModalPresentationFullScreen,导致之前通过 presentViewController:animated:completion: 方法弹出的控制器效果非全屏的问题

通过这种 Category 和 Method Swizzling 的方式,则无需处理之前大量的控制器没有设置 modalPresentationStyle 的问题,同时也不影响之前设置过 modalPresentationStyle 的控制器。

使用方式

Podfile里添加此行内容:

pod 'DVVFixModalPresentationStyle', :git => 'https://github.com/devdawei/DVVFixModalPresentationStyle.git', :tag => 'v1.0.0'

然后在Terminalcd到工程目录,执行如下命令:

pod install

没有使用 CocoaPods 的项目则只需要把DVVFixModalPresentationStyle文件夹拖到项目中即可。

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated8mo ago
Forks1

Languages

Objective-C

Security Score

77/100

Audited on Jul 15, 2025

No findings