Skip to content

Dynamically added text #47

@frantischek

Description

@frantischek

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions