I am going to crazy because of this problem. I spent whole day with googling to solve this problem. But not find solution yet.
This is my problem.
scanBtn.setImage(UIImage(named: "search-1"), for: .normal)
scanBtn.backgroundColor = UIColor(red: 171, green: 178, blue: 186, alpha: 1.0)
// Shadow and Radius
scanBtn.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.25).cgColor
scanBtn.layer.shadowOffset = CGSize(width:0.0, height:2.0)
scanBtn.layer.shadowOpacity = 1.0
scanBtn.layer.shadowRadius = 0.0
scanBtn.layer.masksToBounds = false
scanBtn.layer.cornerRadius = 35.0
I set image to my button and set shadow and corner radius. But conerRadius is not working. If I add clipToBounds = True, cornerRadius working but no shadow. If I don't set image, conerRadius and shadow works well.
Please help me.