---
title: "setPlaceholder(_:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfacetextfield/setplaceholder(_:)"
---

# setPlaceholder(_:)

Sets the text field’s placeholder.

## Declaration

```swift
func setPlaceholder(_ placeholder: String?)
```

## Discussion

Discussion Use placeholders to describe the text field’s expected content to the user. An empty text field displays the placeholder, and any entered text hides the placeholder. The system automatically formats the placeholder, making it obvious that it’s not a valid text entry.

## See Also

### Setting a Placeholder

- [setAttributedPlaceholder(_:)](watchkit/wkinterfacetextfield/setattributedplaceholder(_:).md)
