软件环境
Xcode11 + iOS13
问题列表
Q1:present 不全屏
问题描述:viewController present 的时候,默认没有全屏。
UIModalPresentationStyle枚举
public enum UIModalPresentationStyle : Int {
case fullScreen
@available(iOS 3.2, *)
case pageSheet
@available(iOS 3.2, *)
case formSheet
@available(iOS 3.2, *)
case currentContext
@available(iOS 7.0, *)
case custom
@available(iOS 8.0, *)
case overFullScreen
@available(iOS 8.0, *)
case overCurrentContext
@available(iOS 8.0, *)
case popover
@available(iOS 7.0, *)
case none
@available(iOS 13.0, *)
case automatic
}
原因:
默认没有设置modalPresentationStyle
, iOS13之前,modalPresentationStyle
的默认值是 .fullScreen
,iOS13中默认值是 .automatic
(参见下文中的Discussion)
- iOS13: The default value for this property is UIModalPresentationStyle.automatic.
- <iOS13: modal view controllers are always presented full-screen
// 苹果官方文档
// The presentation style for modally presented view controllers.
var modalPresentationStyle: UIModalPresentationStyle { get set }
// Discussion(Xcode11)
The presentation style determines how a modally presented view controller is displayed onscreen. In a horizontally compact environment, modal view controllers are always presented full-screen. In a horizontally regular environment, there are several different presentation options.
The default value for this property is UIModalPresentationStyle.automatic. For a list of possible presentation styles, and their compatibility with the available transition styles, see the UIModalPresentationStyle constant descriptions.
// ***********************************************************************************************
// Discussion(Xcode9)
The presentation style for modally presented view controllers.
The presentation style determines how a modally presented view controller is displayed onscreen. In a horizontally compact environment, modal view controllers are always presented full-screen. In a horizontally regular environment, there are several different presentation options. For a list of possible presentation styles, and their compatibility with the available transition styles, see the UIModalPresentationStyle constant descriptions.
Q2:UISearchDisplayController在iOS13上闪退
问题描述:在老版本Xcode(<Xcode11)的StoryBoard中拖拽一个UISearchBar控件,当前控制器中会自动附属上UISearchDisplayController,然而UISearchDisplayController在iOS13以后已过时,所以闪退
原因:
疑问:
在本地真机调试(Debug | Release),iOS13设备上未出现闪退,在TestFlight中闪退,Why ???
Q3:Dark模式
问题描述:由于上线比较紧急,就简单粗暴的“适配”了Dark模式:
在Info.plist中,将User Interface Style
的值设置为 Light
其他:来源于互联网
Q4: 私有KVC
问题描述:在使用iOS 13运行项目时,使用KVC修改私有属性,会闪退