Swift - Problems with corner radius and drop shadow
问题 I'm trying to create a button with rounded corners and a drop shadow . No matter how I switch up, the button will not display correctly. I've tried masksToBounds = false and masksToBounds = true , but either the corner radius works and the shadow does not or the shadow works and the corner radius doesn't clip the corners of the button. import UIKit import QuartzCore @IBDesignable class Button : UIButton { @IBInspectable var masksToBounds: Bool = false {didSet{updateLayerProperties()}}