I'm having a hard time getting a drop shadow to show when I am using "User Defined Runtime Attributes".
It seems to work completely fine if I use code, as follows.
func formatView(view: UIView, cornerRadius: Bool) {
if (cornerRadius) {view.layer.cornerRadius = 12 }
view.layer.shadowColor = UIColor.black.cgColor
view.layer.shadowOffset = CGSize.zero
view.layer.shadowRadius = 3
view.layer.shadowOpacity = 0.3
}
But when I try it with User Defined Runtime Attributes it doesn't show anymore. These are the ones I'm currently using.
The only thing that is weird is if I remove the layer.shadowColor
attribute, then it seems to work again. But I can no longer control the color. It seems to default to black, but if I ever decide to choose a grey color instead, I wouldn't be able to change it.
Is this because the Color Attribute is a UIColor and shadowColor expects a CGColor?