Skip to content

Commit

Permalink
IOS-2381 Add helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
mgolovko committed Apr 5, 2024
1 parent 3ff36d0 commit 070d232
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import SwiftUI
import Services

struct IconView: View {

Expand All @@ -20,3 +21,17 @@ struct IconView: View {
}
}
}

extension IconView {
init(asset: ImageAsset) {
self = IconView(icon: .asset(asset))
}

init(object: ObjectIcon) {
self = IconView(icon: .object(object))
}

init(uiImage: UIImage) {
self = IconView(icon: .image(uiImage))
}
}

0 comments on commit 070d232

Please sign in to comment.