Same issue here. Feels like SwiftUI is way less stable than UIKit for having to fix my app every year.
Post
Replies
Boosts
Views
Activity
Hey,
In case it can help someone, here is a version to have within a Form. Works well with iOS 14 on iPhone.
I have a version similar to Othyn.
I added a negative (horizontal) padding to resolve the layout issue.
swift
ZStack {
if self.itemDescription.isEmpty == true {
Text("placeholder")
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
.foregroundColor(Color.tertiaryLabel)
}
TextEditor(text: self.$itemDescription)
.frame(maxHeight: .infinity)
.padding(.horizontal, -5)
}
.font(.body)
Cheers