Tips
iOS 16 真机调试需要设备设置 —> 隐私安全 —> 开发者模式打开开发者模式

适配内容

新增控件内容

  1. UICalendarView 显示日期支持单选与多选
  2. UIPasteControl 读取剪贴板中的内容,跨 App 读取需要授权弹框
  3. UIEditMenuInteraction,取代 UIMenuController 和 UIMenuItem
  4. UIFindInteraction 用于文本内容查找替换
  5. LARightStore 存储获取 keychain 数据
  6. UIImage 新增的构造函数支持 SF Symbols 新增的类别 Variable
lazy var pasteControl: UIPasteControl = {
       // 创建配置
       let config = UIPasteControl.Configuration()
       // 背景色
       config.baseBackgroundColor = .orange
       // 图标文字颜色
       config.baseForegroundColor = .green
       // 形状
       config.cornerStyle = .capsule
       // 显示模式
       config.displayMode = .iconAndLabel
       // 创建UIPasteControl
       let pasteControl = UIPasteControl(configuration: config)
       // 设置target获取剪切板内容后粘贴位置
       pasteControl.target = textField
       pasteControl.frame = CGRect(x: 0, y: 0, width: 200, height: 60)
       pasteControl.center = view.center
       return pasteControl
   }()

//使用方法:在VC中添加control 

view.addSubview(pasteControl)


其他改动

  1. iOS 16 真机调试开启,设置-隐私安全-开发者模式
  2. UIScreen.main将会废弃,建议使用 (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen
  3. UISheetPresentationController 支持自定义显示的 UIViewController 的大小
  4. UINavigationItem 改动
    (新增属性 style 描述 UINavigationItemUINavigationBar上的布局
    (新增属性 backAction 用于自定义 UIViewController 返回button事件
    (新增属性 titleMenuProvider 用于当前导航栏的标题添加操作菜单
  5. UIPageControl 支持垂直显示、设置指示器、设置当前图片
  6. UITableView、UICollectionView 使用 Cell Content Configuration支持使用 UIHostingConfiguration 包装 SwiftUI 代码定义 Cell 的内容。
  7. UITableView、UICollectionView 新增 selfSizingInvalidation 参数,使Cell可以自动调整大小
  8. UIMenu 支持尺寸 smallmediumlarge. 例:UIMenu(title: “”, preferredElementSize: .small, children: menuElements)
  9. UIDevice 获取设备信息时,只能获取设备名称隐私权限增强
  10. UIDevice 不再支持通过支持 setValue() 方法设置设备方向替换为 UIWindowScene 的requestGeometryUpdate() 方法
  11. WidgetFamily 新增分类 accessory ,支持 iOS 锁屏显示和 watchOS 表盘显示

原文地址:https://blog.csdn.net/qingpingguo12/article/details/126886936

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_9321.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注