     
     let borderStyle: BorderStyle
     
-    /// The width of the border in pixels
-    private var pixelWidth: CGFloat {
-        didSet {
-            widthConstraint?.constant = pixelWidth.pixelsToPoints(forContentScaleFactor: currentScale)
-            setNeedsUpdateConstraints()
-        }
-    }
-    
-    /// Insets for the border, used where possible. For instance, on the top border the `insets.bottom` will be ignored
-    private var insets: UIEdgeInsets {
-        didSet {
-            topConstraint?.constant = insets.top
-            bottomConstraint?.constant = -insets.bottom
-            leadingConstraint?.constant = insets.left
-            trailingConstraint?.constant = -insets.right
-            setNeedsUpdateConstraints()
-        }
-    }
-    
     private var widthConstraint: NSLayoutConstraint?
     private var bottomConstraint: NSLayoutConstraint?
     private var topConstraint: NSLayoutConstraint?

        superview.addSubview(self)
        
        if side != .top {
            bottomConstraint = bottomAnchor.constraint(equalTo: superview.bottomAnchor, constant: -insets.bottom)
            bottomConstraint?.isActive = true
        }
        
        if side != .bottom {
            topConstraint = topAnchor.constraint(equalTo: superview.topAnchor, constant: insets.top)
            topConstraint?.isActive = true
        }
        
        if side != .leading {
            trailingConstraint = trailingAnchor.constraint(equalTo: superview.trailingAnchor, constant: -insets.right)
            trailingConstraint?.isActive = true
        }
        
        if side != .trailing {
            leadingConstraint = leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: insets.left)
            leadingConstraint?.isActive = true
        }
        
        if side == .leading || side == .trailing {
            widthConstraint = widthAnchor.constraint(equalToConstant: pixelWidth.pixelsToPoints(forContentScaleFactor: currentScale))
            widthConstraint?.isActive = true
            setContentHuggingPriority(UILayoutPriorityFittingSizeLevel, for: .vertical)
            setContentCompressionResistancePriority(UILayoutPriorityFittingSizeLevel, for: .vertical)
        }
        else if side == .top || side == .bottom {
            widthConstraint = heightAnchor.constraint(equalToConstant: pixelWidth.pixelsToPoints(forContentScaleFactor: currentScale))
            widthConstraint?.isActive = true
            setContentHuggingPriority(UILayoutPriorityFittingSizeLevel, for: .horizontal)
            setContentCompressionResistancePriority(UILayoutPriorityFittingSizeLevel, for: .horizontal)
        }
        
        widthConstraint?.constant = pixelWidth.pixelsToPoints(forContentScaleFactor: currentScale)
        setNeedsUpdateConstraints()
    }
}

        }
        
        self.borderStyle = borderStyle
        super.init(frame: .zero)
        
        widthConstraint?.constant = borderStyle.pixelWidth.pixelsToPoints(forContentScaleFactor: currentScale)
        topConstraint?.constant = borderStyle.insets.top
        bottomConstraint?.constant = -borderStyle.insets.bottom
        leadingConstraint?.constant = borderStyle.insets.left
        trailingConstraint?.constant = -borderStyle.insets.right
        
        isUserInteractionEnabled = false
        translatesAutoresizingMaskIntoConstraints = false
