I want to increase the shadow distribution in my UILabel, but I cannot find a property for this. I have added a photo below to illustrate this problem.

The top shortcut is the desired effect that I can create in Photoshop. The bottom label illustrates the properties that I could find in iOS. Here is the code I used for the bottom label.
let bottomLabel = UILabel(frame: CGRectMake(0, 0, maxWidth, 18)) bottomLabel.backgroundColor = UIColor.clearColor() bottomLabel.textColor = UIColor.whiteColor() bottomLabel.font = UIFont.boldSystemFontOfSize(16) bottomLabel.text = title bottomLabel.textAlignment = .Center bottomLabel.numberOfLines = 1 bottomLabel.layer.shadowOffset = CGSize(width: 0, height: 0) bottomLabel.layer.shadowOpacity = 1 bottomLabel.layer.shadowRadius = 2
I found a suggestion to use the second mark as a shadow, but this did not give the desired result. Here is the code for this tag.
let bottomLabelShadow = UILabel(frame: CGRectMake(0, 1, maxWidth, 18)) bottomLabelShadow.backgroundColor = UIColor.clearColor() bottomLabelShadow.textColor = UIColor.blackColor() bottomLabelShadow.font = UIFont.boldSystemFontOfSize(16) bottomLabelShadow.text = title bottomLabelShadow.textAlignment = .Center bottomLabelShadow.numberOfLines = 1 bottomLabelShadow.layer.shadowOffset = CGSize(width: 0, height: 0) bottomLabelShadow.layer.shadowOpacity = 1 bottomLabelShadow.layer.shadowRadius = 2
ios uilabel swift shadow
evenwerk
source share