Home > Mobile >  How to give corner radius using storyboard?
How to give corner radius using storyboard?

Time:06-10

i want to give brder radious like

key path : layer.cormerRadios value : frame.size.height / 2

in story board there is an one more option type so which type should i give ?

CodePudding user response:

easiest way is to create an @IBInspectable as an extension

extension UIView {

@IBInspectable
    var cornerRadius: CGFloat {
        get {
            return layer.cornerRadius
        }
        set {
            layer.cornerRadius = newValue
        }
    }

}

Corner Radius in IB

  • Related