Search code examples
iosswiftxcodestoryboarduitextfield

How to give corner radius using storyboard?


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 ?


Solution

  • 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