Skip to content

Commit

Permalink
FluentIcon+SwiftUI (#698)
Browse files Browse the repository at this point in the history
- Added support for swiftUI
  • Loading branch information
maheshwaran01m authored Sep 12, 2024
1 parent 3255f2f commit fd0e040
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ios/FluentIcons/Classes/FluentIcon+SwiftUI.swift
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit fd0e040

Please sign in to comment.