@IBOutlet weak var button1: UIButton! @IBOutlet weak var button2: UIButton! @IBOutlet weak var button3: UIButton! @IBOutlet weak var button4: UIButton!
The next step is to add the code in a function such as viewDidLoad
button1.layer.cornerRadius = 5.0 button2.layer.cornerRadius = 5.0 button3.layer.cornerRadius = 5.0 button4.layer.cornerRadius = 5.0
Note the cornerRadius is a property of the layer of the button not the button it's self.
Finally, make sure that Clip to Bounds is checked for each object in the Attribute Inspector.
This gives a nice round corner under program control.