Can't make buttons rectangular!

Ever since Xcode Version 26.0.1 I cannot for the life of me make my buttons rectangular. They are all capsule (or oval) shaped. My interface was designed for square buttons but no matter what I do the issue stays the same. This is what I have (it's fairly barebones but would have worked before I believe):

 @IBOutlet weak var PagesInterface: UIButton!
    

    override func viewDidLoad() {
        super.viewDidLoad()
        PagesInterface.layer.cornerRadius = 0
        PagesInterface.layer.masksToBounds = true
    }

Change your code in viewDidLoad to:

var cfg = PagesInterface.configuration
cfg?.cornerStyle = .fixed // Or change the button's "Corner Style" to "Fixed" in the storyboard
cfg?.background.cornerRadius = 0
PagesInterface.configuration = cfg

With a style of fixed the button's corner radius comes from the background's cornerRadius property.

Please also note that it is common practice to name variables starting with lowercase letters. Your PagesInterface variable should be named pagesInterface. Uppercase names are usually used for class/struct/enum names.

Can't make buttons rectangular!
 
 
Q