ios rounded button

Swift
   button.layer.cornerRadius = button.frame.size.height / 2
// must be in the viewDidLoad func
   
Source

Also in Swift: