1

当我的项目构建成功并完成启动时,控制台输出如下:

2021-07-06 17:28:28.913313+0800 YueTime[44591:286098] [TraitCollection] Class CKBrowserSwitcherViewController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.

macOS 10.15.7 Xcode12.2(12B45b) 斯威夫特 5.1

在此处输入图像描述

如何解决?

4

1 回答 1

0

答案在这里

相同的线程在这里,并不特定于 SwiftUI,但根据 Apple 的说法,如果它是像“CKBrowserSwitcherViewController”这样的系统类,则可以安全地忽略此警告。但是,如果生成的类是自定义类,那么这对您来说是一个合法的警告。

顺便说一句,将 Xcode 更新到最新版本是个好主意。

于 2021-07-06T09:58:04.483 回答