Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swiftui coin flip

@State private var flippedHeads = true
    var body: some View {
        Text(flippedHeads ? "Heads" : "Tails")
            .onTapGesture { flippedHeads = Bool.random() }
    }
Source by developer.apple.com #
 
PREVIOUS NEXT
Tagged: #swiftui #coin #flip
ADD COMMENT
Topic
Name
9+2 =