Anurag Sharma
Anurag Sharma

Reputation: 4824

Hide placeholder Programatically using swift 3x

How to hide the placeholder of TextField programmatically using Swift 3x ?

Upvotes: 0

Views: 1486

Answers (1)

Nirav D
Nirav D

Reputation: 72410

You can not hide the placeholder of UITextField, but you can set it to empty String.

self.textField.placeholder = ""

Now textField doesn't show any placeholder later on if you want to show the placeholder simply set it with String that you want.

self.textField.placeholder = "Enter name"

Upvotes: 2

Related Questions