Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created May 2, 2023 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/b54f0dc8cc527ef5e2d3fc3391033df3 to your computer and use it in GitHub Desktop.
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