Post

Replies

Boosts

Views

Created

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
2
2.2k
Feb ’23
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()                 }
Replies
2
Boosts
2
Views
2.2k
Activity
Feb ’23
Sort by date after searching
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.
Replies
2
Boosts
0
Views
1k
Activity
Jul ’20