SF Symbols provides a set of over 2,400 consistent, highly configurable symbols you can use in your app. Apple designed SF Symbols to integrate seamlessly with the San Francisco system font, so the symbols automatically ensure optical vertical alignment with text in all weights and sizes.
https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/
As far as I can see, macOS does not support NSImage(systemName: String)
syntax when trying to use SF Symbols in a macOS project.
To be specific, I was trying to use an SF Symbol glyph on a toolbar item.
SwiftUI uses the systemName parameter for SF Symbol lookup. Keep in mind that you can use string interpolation to show an SF Symbol as the part of any text. Another SwiftUI view that plays well with SF Symbols is Label. The Label view contains both text and an image and shows them according to the current context.
You are not able to use this icons on the websites as license of SF symbols do not allow use those symbols externally than apple's products.
SF Symbols is not supported on macOS (yet)
But you can download the SF Symbols App and export the symbols you need as stand-alone images.
SF Symbol are now available with macOS 11.
SF Symbols are available in iOS 13 and later, macOS 11 and later, watchOS 6 and later, and tvOS 13 and later.
Here is how you use it:
NSImage(systemSymbolName: "hammer", accessibilityDescription: nil)
If you want to support macOS 10.15 and below you have to use the SF Symbols Mac app and export the symbol as SVG and import it back to an asset file in your Xcode project. You can get the app from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With