我正在使用 SwiftUI SF Symbols,在 iOS 14 上运行良好,但在 iOS 13 上运行良好,错误如下:
[SwiftUI] No system image named 'doc.badge.gearshape' was found
[SwiftUI] No system image named 'airport.express' was found
[SwiftUI] No system image named 'rectangle.badge.plus' was found
用法很简单:
Image(systemName: "doc.badge.gearshape")
如果这是因为图标仅在 iOS 14 上退出,那么解决此问题的正确方法是什么?我必须使用:
if #available(iOS 14.0, *) {
Image(systemName: "doc.badge.gearshape")
} else {
Image("xxx")
}