ConfettiSwiftUI icon indicating copy to clipboard operation
ConfettiSwiftUI copied to clipboard

Dynamically added text

Open frantischek opened this issue 11 months ago • 0 comments

I try to add an emoji which is recieved by an APN:

    @State private var receivedEmoji: String = "🎉"
    @State private var cannonEmoji: String = "🥥"
[...]
        VStack {
[...]
        .onChange(of: receivedEmoji) { newValue in
            animationCounter += 1
            cannonEmoji = newValue
            print("Emoji \(cannonEmoji)") <--- here it prints the recieved emoji and not the initialized one.
        }
       // .animation(.easeInOut(duration: 0.5), value: sortedActions)
        ConfettiCannon(counter: $animationCounter ,confettis: [.text(cannonEmoji)], confettiSize: 20)

.text(cannonEmoji)allways fires the coconut (🥥) - which looks also great. :D

How can I solve this?

frantischek avatar Feb 27 '24 10:02 frantischek