How to make a round button?

I want to make round buttons with @IBDesignable. I think that the RoundButton file doesn't have a problem. I think it's about the errors, but I don't know how to solve them. // // //

// RoundButton.swift

import UIKit

@IBDesignable
class RoundButton: UIButton {
 @IBInspectable var isRound: Bool = false {
  didSet {
   if isRound {
    self.layer.cornerRadius = self.frame.height / 2
   }
  }


 }
}

Screenshots are interesting, but you'd better show also error messages in text.

For a custom button, I do usually this:

@IBDesignable class RoundButton: UIButton {
    
 @IBInspectable var isRound: Bool = false {
  didSet {
     if isRound {
       self.layer.cornerRadius = self.frame.height / 2
     } else {
        self.layer.cornerRadius = 0  // You probably have to add this
     }
  }

    override init(frame: CGRect) {
        super.init(frame: frame)
        commonInit()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        commonInit()
    }
    
     private func commonInit() {
          self.clipsToBounds = true
          self.backgroundColor = .red
     }
}
How to make a round button?
 
 
Q