目前我已经在我的 iphone 中启用了暗模式。但 UITraitCollection.current.userInterfaceStyle 总是将当前模式返回为“未指定”。
我想获取当前选择的设备/系统/操作系统模式。
if UITraitCollection.current.userInterfaceStyle == .dark {
print("Yes dark mode")
} else {
print("Not dark mode")
}```