0

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?

Community
  • 1
  • 1
Ram Iyer
  • 1,325
  • 2
  • 19
  • 27

1 Answers1

2

Set the alpha to 0:

myLabel.alpha = 0 
CoderPi
  • 12,423
  • 4
  • 31
  • 59
Lukesivi
  • 2,176
  • 4
  • 24
  • 42