iOS 13 适配(持续更新中)

私有KVC

与系统版本无关,与Xcode版本有关,Xcode11编译会奔溃。

其中UITextField

[textField setValue:[UIColor xxx] forKeyPath:@"_placeholderLabel.textColor"];

dis -n "-[UITextField valueForKey:]" 命令

其中UISearchBar

[self setValue:@"xxx " forKey:@"_cancelButtonText"];

iOS 13searchbar添加了一个- (void)set_cancelButtonText:(NSString *)text方法,这个方法专门用来命中kvc。一旦命中 就 crash

通过计算TabBar上的图片位置设置红点,红点位置有偏移

如果之前有通过TabBar上图片位置来设置红点位置,在iOS13上会发现显示位置都在最左边去了。遍历UITabBarButtonsubViews发现只有在TabBar选中状态下才能取到UITabBarSwappableImageView,解决办法是修改为通过UITabBarButton的位置来设置红点的frame

黑夜模式

Apps on iOS 13 are expected to support dark mode Use system colors and materials Create your own dynamic colors and images Leverage flexible infrastructure

Apps on iOS 13 are expected to support dark mode Use system colors and materials

审核强制要求适配黑夜模式,近在咫尺。

苹果登录

Sign In with Apple will be available for beta testing this summer. It will be required as an option for users in apps that support third-party sign-in when it is commercially available later this year.

如果 APP 支持三方登陆(Facbook、Google、微信、QQ、支付宝等),就必须支持苹果登陆,且要放前边。

对于非iOS平台,Web、Android 可以使用 JS SDK,网页版本登录,逻辑类似、Facebook、QQ登录。

建议支持使用Apple提供的按钮样式,已经适配各类设备。

模态弹出默认交互改变

Defines the presentation style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter.
If this property has been set to UIModalPresentationAutomatic, reading it will always return a concrete presentation style. By default UIViewController resolves UIModalPresentationAutomatic to UIModalPresentationPageSheet, but other system-provided view controllers may resolve UIModalPresentationAutomatic to other concrete presentation styles.

iOS 13 的 presentViewController 默认有视差效果,模态出来的界面现在默认都下滑返回。 一些页面必须要点确认才能消失的,需要适配。如果项目中页面高度全部是屏幕尺寸,那么多出来的导航高度会出现问题。

App启动过程中部分View可能无法实时获取到frame

可能是为了优化启动速度,App 启动过程中,部分View可能无法实时获取到正确的frame

AppDelegate获取DeviceToken失败

以下方法中:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) 

在iOS 13中可以通过以下方法获取:

let token = [UInt8](deviceToken).map{String(format: "%02x", $0)}.joined()
print("\(token)")
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 追了覃杰3次,终于搞定了自己! 2018.11.10 007不出局第20站中国行,在杭州! 这是我第3次参加覃杰...
    初苗说阅读 5,712评论 11 17
  • 时光不会倒流,可是,我仍然想着你。嘴巴上说着忘记的人,心里却是念念不忘。我说过好多好多次我已经忘了你,已经走出来了...
    呼叫史迪仔阅读 1,801评论 0 0
  • 文/刘彩霞 (十八) 草草吃口饭,大郭披上大衣,敞着怀儿,来到外面,隔着村小的墙头,上半身几乎快要伸到墙外了。下嘴...
    彩霞漫天阅读 1,702评论 0 0
  • 做音乐网站要实现展示歌手歌曲的功能,看了许多api,感觉就酷狗的简单,好用,这是原作者的方法,原文大概如下:酷狗M...
    javaLi阅读 5,572评论 0 1

友情链接更多精彩内容