Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created May 2, 2023 14:30
Show Gist options
  • Select an option

  • Save sturdysturge/b54f0dc8cc527ef5e2d3fc3391033df3 to your computer and use it in GitHub Desktop.

Select an option

Save sturdysturge/b54f0dc8cc527ef5e2d3fc3391033df3 to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
@State var text = "Example text"
var body: some View {
VStack {
TextField("", text: $text)
.textFieldStyle(RoundedBorderTextFieldStyle())
Button("Print") { print(text) }
}
.padding()
.onAppear {
if runningForPreviews {
console.isVisible = true
console.fontSize = 15
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment