自从升级到 iPadOS 16 以来,Xcode 的控制台已经充满了诸如[VKImageAnalyzer processRequest:] returned 0或 之类的消息[VKImageAnalyzer processRequest:] block returned NULL analysis- 这发生在模拟器中,并且在物理设备上我收到有关字体的警告,例如CoreText performance note: Client called CTFontCreateWithName() using name "Times-Roman" and got font with PostScript name "TimesNewRomanPSMT". For best performance, only use PostScript names when calling this API.
我的应用程序使用 PDFKit 显示乐谱的 PDF 文件,因此 iOS 16 中引入的 PDF 文件的自动图像分析与其完全无关。除了向控制台发送垃圾邮件之外,此功能还会消耗不必要的资源。
我找不到任何有关禁用 PDFKit 中自动 PDF 分析的方法的文档。任何想法都会非常受欢迎。
我正在尝试更新旧的应用程序以使用新的 NavigationSplitView 和 NavigationLink,但当侧边栏具有子对象层次结构并且我想从远处更新详细视图时,我试图以正确的方式进行操作子对象。例如,基于 WWDC2022 示例项目 Navigation Cookbook,我尝试了以下操作,但没有成功:
测试应用程序.swift
@main
struct TestApp: App {
@StateObject var appState = AppState()
var body: some Scene {
WindowGroup {
NavigationSplitView {
ProjectListView()
} detail: {
if let chapter = appState.chapter {
ChapterDetailView(chapter: chapter)
} else {
Text("Pick a Chapter")
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
ChapterListView.swift < ProjectListView() 的远亲(向下 3 级)兄弟
List(selection: $appState.chapter) {
ForEach(chapters) { chapter in
NavigationLink(chapter.title ?? "A Chapter", value: chapter)
}
}
Run Code Online (Sandbox Code Playgroud)
appState.swift
class AppState: ObservableObject {
@Published var chapter: …Run Code Online (Sandbox Code Playgroud) swiftui swiftui-navigationlink ios16 swiftui-navigationsplitview ipados16
ios16 ×2
ipados16 ×2
ios-pdfkit ×1
ocr ×1
swiftui ×1
swiftui-navigationsplitview ×1
visionkit ×1