When adding a TextEditor to a macOS app with SwiftUI the text is too close to the top edge. It seems like I need to be able to set 'edgeInsets' on the TextEditor but I can't seem to figure out how to do that through SwiftUI. To be honest this just seems like a big oversight because this close to the edge seems like an error rather than intentional.
You can see on my attached screenshot, the TextEditor is the darker background with the rounded edges.
HSplitView {
TextEditor(text: $inputText)
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
.foregroundColor(.secondary)
.padding()
.navigationTitle(selectedTool?.rawValue ?? "Text Utility")
TextEditor(text: $outputText)
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
.foregroundColor(.secondary)
.padding()
}
Post
Replies
Boosts
Views
Activity
It’d be great if we could sort by date when searching the forums. Especially post WWDC where everything you want to see will most likely be posted in the last couple weeks. For example when searching for ‘swift playgrounds’ most of the items are from years ago when I really just want to see the last few weeks.