Skip to content

Commit

Permalink
add ImageResource initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Apr 30, 2024
1 parent 84c03d0 commit cde93a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/UIComponent/Components/View/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public struct Image: Component {

}

/// Initializes an `Image` component with an `ImageResource`.
/// - Parameter resource: The `ImageResource` to load the image from.
@available(iOS 17.0, *)
public init(_ resource: ImageResource) {
self.init(UIImage(resource: resource))
}

/// Initializes an `Image` component with the name of a system image (SFSymbol).
/// - Parameters:
/// - systemName: The name of the system image to load.
Expand Down

0 comments on commit cde93a1

Please sign in to comment.