第1年6月30日 swiftui playgrounds
作者:互联网
1.
import SwiftUI import PlaygroundSupport struct ContentView : View { @State var index = 0 var body: some View { VStack{ Text("hello world") .padding() Text("\(self.index)") .padding() Button("tap me"){ self.index = self.index+1 } } } } PlaygroundPage.current.setLiveView(ContentView())
https://www.jianshu.com/p/00eeafbfc163
标签:index,ContentView,playgrounds,self,30,padding,swiftui,var,import 来源: https://www.cnblogs.com/javastart/p/14953462.html