Ram Iyer
Ram Iyer

Reputation: 1564

Hiding and showing UILabel with rounded corner and shadow in Swift 2

I am using this method Swift - Problems with corner radius and drop shadow to add rounded corners and shadow to a UILabel.

However, I need to hide and unhide the label depending on content. I am setting hidden true/false in my ViewController class. But the shadow layer still shows.

See example images below.

enter image description here

What is the best way to hide/unhide this shadow layer as well?

Upvotes: 0

Views: 616

Answers (1)

Lukesivi
Lukesivi

Reputation: 2226

Set the alpha to 0:

myLabel.alpha = 0 

Upvotes: 2

Related Questions