From fd0e0405df2990b2a009e7e010b6250e36156d38 Mon Sep 17 00:00:00 2001 From: Maheshwaran <102943217+maheshwaran01m@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:07:42 +0530 Subject: [PATCH] FluentIcon+SwiftUI (#698) - Added support for swiftUI --- .../Classes/FluentIcon+SwiftUI.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ios/FluentIcons/Classes/FluentIcon+SwiftUI.swift 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 + } +}