diff --git a/ios/FluentIcons/Classes/FluentIcon+SwiftUI.swift b/ios/FluentIcons/Classes/FluentIcon+SwiftUI.swift new file mode 100644 index 0000000000..58412c3b74 --- /dev/null +++ b/ios/FluentIcons/Classes/FluentIcon+SwiftUI.swift @@ -0,0 +1,18 @@ +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +// + +import SwiftUI + +@available(iOS 13.0, macOS 10.15, *) +public extension Image { + + init(fluent: FluentIcon) { + #if os(macOS) + self.init(nsImage: NSImage.fluentIcon(fluent)) + #else + self.init(uiImage: UIImage(fluent: fluent)) + #endif + } +}