6

I'm trying to achieve something exactly like this:

enter image description here

I've found a few questions related to mine:

  1. How to set the colors in glowing effect of a UILabel?
  2. IPhone Text Glow Effect
  3. Create glowing text effect on iOS
  4. xcode UILabel text add outer glow effect

The majority of the answers suggests modifying the UILabel's layer property by adjusting its shadow, and the questions are outdated.

I've tried the suggestions using the following code:

myLabel.layer.shadowColor = UIColor.black.cgColor
myLabel.layer.shadowOffset = .zero
myLabel.layer.shadowRadius = 2.0
myLabel.layer.shadowOpacity = 1.0
myLabel.layer.masksToBounds = false
myLabel.layer.shouldRasterize = true

And got the following result:

enter image description here

The glow is not strong enough and doesn't disperse out more. I've tried playing around with offset, radius, and opacity but the glow was either the same or less distinct.

Is this still possible or is there a work-around that someone can suggest to me?

Thanks

Pangu
  • 3,721
  • 11
  • 53
  • 120

1 Answers1

3

Change the shadow color to white:

myLabel.layer.shadowColor = UIColor.white.cgColor
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
dnzsy
  • 33
  • 4