File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public enum ConfettiType:CaseIterable, Hashable {
20
20
case shape( Shape )
21
21
case text( String )
22
22
case sfSymbol( symbolName: String )
23
+ case image( String )
23
24
24
25
public var view : AnyView {
25
26
switch self {
@@ -35,6 +36,8 @@ public enum ConfettiType:CaseIterable, Hashable {
35
36
return AnyView ( Text ( text) )
36
37
case . sfSymbol( let symbolName) :
37
38
return AnyView ( Image ( systemName: symbolName) )
39
+ case . image( let image) :
40
+ return AnyView ( Image ( image) . resizable ( ) )
38
41
default :
39
42
return AnyView ( Circle ( ) )
40
43
}
@@ -91,6 +94,8 @@ public struct ConfettiCannon: View {
91
94
switch confetti {
92
95
case . shape( _) :
93
96
shapes. append ( AnyView ( confetti. view. foregroundColor ( color) . frame ( width: confettiSize, height: confettiSize, alignment: . center) ) )
97
+ case . image( _) :
98
+ shapes. append ( AnyView ( confetti. view. frame ( maxWidth: confettiSize, maxHeight: confettiSize) ) )
94
99
default :
95
100
shapes. append ( AnyView ( confetti. view. foregroundColor ( color) . font ( . system( size: confettiSize) ) ) )
96
101
}
You can’t perform that action at this time.
0 commit comments