In Xcode make sure Editor -> Automatically refresh views is checked.

Automatically refresh views

Create a new Swift file.

import UIKit

@IBDesignable
class BoxView: UIView {

    override func prepareForInterfaceBuilder() {
        super.prepareForInterfaceBuilder()
        layer.borderColor = borderColor?.cgColor
        layer.borderWidth = borderWidth
        layer.cornerRadius = cornerRadius
    }

    @IBInspectable var borderColor: UIColor? {
        didSet {
            layer.borderColor = borderColor?.cgColor
            setNeedsLayout()
        }
    }

    @IBInspectable var borderWidth: CGFloat = 0.0 {
        didSet {
            layer.borderWidth = borderWidth
            setNeedsLayout()
        }
    }

    @IBInspectable var cornerRadius: CGFloat = 0.0 {
        didSet {
            layer.cornerRadius = cornerRadius
            setNeedsLayout()
        }
    }
}

Create a UIView in InterfaceBuilder. In the Identity Inspector set the class to "BoxView".

Boxview custom class

In the Attributes Inspector set borderColor, borderWidth, and cornerRadius.

Boxview attributes

Download Sample Project on GitHub