美文网首页
37期_Xcode_多窗口的info.plist配置了解

37期_Xcode_多窗口的info.plist配置了解

作者: 萧修 | 来源:发表于2023-09-07 01:00 被阅读0次

iOS13之后,Appdelegate负责生命周期,scene负责UI。

旧项目适配场景步骤

  • Info.plist文件中添加Application Scene Manifest配置;
  • 实现UIApplicationDelegate新增的管理scene生命周期的方法;
  • 实现scene代理。

Application Scene Manifest

Enable Multiple Windows

标记该app是否支持多窗口,目前iOS是不支持多窗口,只有iPadOS支持多窗口

Scene Configuration

字典结构,用来添加scene配置信息。包括External Display Session Role的数组结构和Application Session Role

External Display Session Role

和外部设备有关系

Application Session Role

可以配置的信息有四个,ClassName,Configuration Name、Delegate Class Name、Storyboard Name

  • Class Name:scene的类名,必须是scene的子类,如果是Application Session Role,必须是UIWindowScene的子类
  • Configuration Name:为这个配置起名,必选值
  • Delegate Class Name:scene代理的类名,如果是Application Session Role,必须实现UIWindowSceneDelegate

scene对象和scene代理都不允许手动创建,只能在info.plist指定

相关文章

网友评论

      本文标题:37期_Xcode_多窗口的info.plist配置了解

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