美文网首页
适配iOS 13

适配iOS 13

作者: 杨闯 | 来源:发表于2019-08-17 08:19 被阅读0次

1、presentViewController出来的页面,默认是卡片样式的,可以下滑移除,如果不想使用卡片模式,可以通过self.modalPresentationStyle = UIModalPresentationFullScreen;的方式进行修改,具体可查看 https://juejin.im/post/5d00af64e51d455d88219ee2
2、iOS 13增加了暗黑模式,如果想要对其进行自己的定义,可以修改UIUserInterfaceStyle来限制

Value of key User’s dark appearance setting Trait used for app UI Description
"Automatic" Off UIUserInterfaceStyleLight Respects the systemwide setting; uses light appearance
"Automatic" On UIUserInterfaceStyleDark Respects the systemwide setting; uses dark appearance
"Light" (ignored) UIUserInterfaceStyleLight Always uses light appearance
"Dark" (ignored) UIUserInterfaceStyleDark Always uses dark appearance
(key not present in Info.plist file, or incorrect value) (ignored) UIUserInterfaceStyleLight Always uses light appearance
内容来源:https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW44

3、OS13系统不让 KVC 的方式 来取或修改私有属性,比如通过- (void)setValue:(nullable id)value forKeyPath:(NSString *)keyPath
设置私有属性和 - (nullable id)valueForKeyPath:(NSString *)keyPath; 获取私有属性

4、 修改兼容iOS 13后,因为不能用kvc的方式修改私有属性,所以UISearchbar的placeholder颜色不能用老的方式进行修改,新的修改方式可参考http://yoferzhang.com/post/20190604Searchbarios13/

相关文章

网友评论

      本文标题:适配iOS 13

      本文链接:https://www.haomeiwen.com/subject/rtchsctx.html