79373846

Date: 2025-01-21 09:32:59
Score: 0.5
Natty:
Report link

Declare and initialize the placeholder

@State private var specialInstructions = "Special Instructions"

Take it off once the user starts typing

TextEditor(text: $specialInstructions)
.foregroundStyle(.black) // Set your text color
.frame(height: 50) // Set the height you want for your field
.cornerRadius(8.0)
.onTapGesture(perform: {
if specialInstructions == "Special Instructions" {
    self.specialInstructions = ""
  }
})
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @State
Posted by: Dankyi Anno Kwaku