1

I'm trying to use SwiftUI on my iPad with Swift Playgrounds. The view below renders fine initially, but unfortunately the view does not update when @State changes, like it does on my Mac. In the little sidebar I can see the closure does get executed though...

I'm using the newest non-beta version of everything.

import SwiftUI
import PlaygroundSupport

struct ContentView: View {
    @State private var tapCount = 0

    var body: some View {
        Button("Tap count: \(tapCount)") {
            tapCount += 1
        }
    }
}

PlaygroundPage.current.setLiveView(ContentView())

Thanks.

NicolasElPapu
  • 1,612
  • 2
  • 11
  • 26
Rick
  • 59
  • 5

1 Answers1

1

See https://developer.apple.com/forums/thread/677361. Enable Results should be turned off.

Rick
  • 59
  • 5