Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 4, 2021 20:40
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/748bbd345004e6f8258a27ae2cf3bb2c to your computer and use it in GitHub Desktop.
Save sturdysturge/748bbd345004e6f8258a27ae2cf3bb2c to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State var text: String = ""
@State var fontWeight = WeightType.regular
@State var fontSize = CGFloat(12)
@State var foregroundColor = Color.primary
var body: some View {
ScrollView(.vertical) {
VStack {
TextEditorView(text: $text,
fontSize: fontSize,
fontWeight: fontWeight.weight,
foregroundColor: foregroundColor)
HStack {
DeleteAllButton(text: $text)
FontColourPicker(colour: $foregroundColor)
}
.frame(height: 50)
FontSizeStepper(fontSize: $fontSize)
FontWeightPicker(fontWeight: $fontWeight)
}
.padding(.horizontal)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment