Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 4, 2021 20:23
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/48932a09d543e1c81a8aca92520ab3d6 to your computer and use it in GitHub Desktop.
Save sturdysturge/48932a09d543e1c81a8aca92520ab3d6 to your computer and use it in GitHub Desktop.
struct TextEditorView: View {
@Binding var text: String
let fontSize: CGFloat
let fontWeight: Font.Weight
let foregroundColor: Color
var body: some View {
TextEditor(text: $text)
.font(.system(size: fontSize, weight: fontWeight))
.foregroundColor(foregroundColor)
.frame(height: 300)
.padding()
.border(Color.secondary, width: 4)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment