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,404
  • 2
  • 20
  • 27

1 Answers1

2

Set the alpha to 0:

myLabel.alpha = 0 
CoderPi
  • 12,985
  • 4
  • 34
  • 62
Lukesivi
  • 2,206
  • 4
  • 25
  • 43