I want to make a round UIButton, but with a slight blurry effect with brightness, since it is a background
So far I have a rounded UIButton, but the code I found on the network (I am new to iOS development, so I don’t understand how blur works, etc.) to add blur, just puts it as a whole, which makes the button again square.
I also tried adding a view, then UIButton, and then a blur effect, and applied the cornerRadius code to that view, but it also didn't work.
Here is what I tried:
shortcutButton.layer.cornerRadius = 0.5 * shortcutButton.bounds.size.width
let blur = UIVisualEffectView(effect: UIBlurEffect(style:
UIBlurEffectStyle.Light))
blur.frame = shortcutButton.bounds
blur.userInteractionEnabled = false
shortcutButton.insertSubview(blur, atIndex: 0)
source
share