
This library is released under the MIT License. ContributingĬontributions are very much welcome! See CONTRIBUTING.md for more information. iconImageView.image UIImage(systemName: phone) restaurant.phone lectionStyle. Dynamic localization information will still be retained. Static localization only exposes the localizations which are actually available, so you cannot accidentally localize a non-localizable symbol.ĭynamic localization, in contrast, is useful when dealing with an array of SFSymbols which all have different available localizations.Īttention: Serializing and deserializing SFSymbols currently makes them lose their explicit static localization information. availableLocalizations // let a = SFSymbol. let image UIImage(systemName: 'textbox').withConfiguration(UIImage.SymbolConfiguration(pointSize: 30, weight. rtl // doesn't compile: "character.rtl" doesn't exist // a, b have type SFSymbol // 2. To retrieve a custom symbol image you store in an asset catalog, use the init (named:in:compatibleWith:) method instead. zh // corresponds to "character.zh" let c = SFSymbol. ar // corresponds to "character.ar" let b = SFSymbol. To integrate using the standalone version of Apple's Swift Package Manager, add the following as a dependency to your Package.swift: In the following step, select SFSafeSymbols as the package product and click Finish. When asked about the version, leave the preselection and click Next.

To integrate SFSafeSymbols using the Xcode-built-in SPM, choose File → Swift Packages → Add Package Dependency. Supported platforms are iOS (11.0+), macOS (10.13+), tvOS (11.0+) and watchOS (4.0+), although the actual functionality is of course only accessible starting with iOS 13.0, macOS 11.0, tvOS 13.0 and watchOS 6.0. SFSafeSymbols can be installed via the Swift Package Manager (recommended), Carthage or CocoaPods.

The following SF Symbols versions are currently supported: SF Symbols Version renamed symbols can be detected easily (via a deprecation notice which suggests the use of the new name at the same time). In summary In this weeks post, you learned how you can find, use and configure Apples SF Symbols in your apps.
Uiimage systemname code#
Each symbol is only made available on those platform versions where Apple says it's available. let defaultImage UIImage (systemName: 'pencil') let whiteImage defaultImage.withTintColor (.white) The above code can be used to create a white pencil icon that you can use wherever needed in your app. large) let largeBoldDoc UIImage(systemName:, withConfiguration: largeConfig).

multiple SF Symbols versions are supported at the same time (via utilization of the flag). SymbolConfiguration(pointSize: 140, weight. about available layersets, available localizations & the look of the symbol) are no longer needed because every symbol is documented in code. This is because all symbols are tested via a CI (on the latest iOS & tvOS versions and also some earlier OS versions). you can be sure your symbol code won't crash due to typos or symbol availability issues. And this is just the basic idea behind SFSafeSymbols! It didn't take long until first ideas came up to make these icons accessible in a safe way using a framework.
