Skip to content

Instantly share code, notes, and snippets.

@diamantidis
Created July 5, 2020 15:31
Show Gist options
  • Save diamantidis/bf9d1ffb70c1f185298e7e16136865db to your computer and use it in GitHub Desktop.
Save diamantidis/bf9d1ffb70c1f185298e7e16136865db to your computer and use it in GitHub Desktop.
import SwiftUI
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public extension Image {
/// Creates an image object containing a system symbol image.
///
/// - Parameter sfSymbol: The name of the `SFSymbol`
/// - Usage
/// ```
/// Image(sfSymbol: .checkmarkCircleFill)
/// ```
@available(OSX, unavailable)
init(sfSymbol: SFSymbol) {
self.init(systemName: sfSymbol.rawValue)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment