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
}
}
}
}