I don't use it much, so I will write it for output.
・ The value of cornerRadius should be around 15.0 ~ 20.0 if only the edges are rounded. -ShadowColor is the color of the shadow. Choose your favorite color, gray or black. -Shadow Radius is the roundness of the shadow. I wonder if this should be about 3-5. -ShadowOffset is the size of the shadow. It can be specified by CGSize. -ShadowOpacity is the transparency of the shadow. I'm sorry, this is suitable. Try changing the value.
ViewController.swift
func ButtuonShadow(position: UIButton){
//Add a shadow to the button to make it round
position.layer.cornerRadius = screenWidth/12
position.layer.shadowColor = UIColor.black.cgColor
position.layer.shadowRadius = 3
position.layer.shadowOffset = CGSize(width: 2, height: 2)
position.layer.shadowOpacity = 0.5
}
It seems that there is not much demand, but if you add a lot of buttons. I hope it helps even one person.