Post

Replies

Boosts

Views

Activity

How to set edge insets for TextEditor for macOS in SwiftUI
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()                 }
2
1
1.2k
Feb ’23