     if borderSides.contains(.left) {
       lines.append((start: CGPoint(x: shift, y: 0), end: CGPoint(x: shift, y: bounds.size.height)))
     }
-
-    for linePoints in lines {
-      borderPath.move(to: linePoints.start)
-      borderPath.addLine(to: linePoints.end)
-    }
-
-    border.path = borderPath.cgPath
-    border.fillColor = UIColor.clear.cgColor
-    border.strokeColor = borderColor.cgColor
-    border.lineWidth = borderWidth
-    border.frame = bounds
-    layer.insertSublayer(border, at: 0)
+    return lines
   }
 }

  }
}

private extension BorderDesignable where Self: UIView {
  func commonConfigBorder() {
    guard let borderColor = borderColor, borderWidth > 0 else {
      return
    }

    // Clear borders
    layer.borderColor = nil
    layer.borderWidth = 0
    layer.sublayers?.filter { $0.name == "borderSideLayer" || $0.name == "borderAllSides" }
      .forEach { $0.removeFromSuperlayer() }

    // if a layer mask is specified, only border the mask
    if let mask = layer.mask as? CAShapeLayer {
      let borderLayer = CAShapeLayer()
      borderLayer.name = "borderAllSides"
      borderLayer.path = mask.path
      borderLayer.fillColor = UIColor.clear.cgColor
      borderLayer.strokeColor = borderColor.cgColor
      borderLayer.lineWidth = borderWidth
      borderLayer.frame = bounds
      layer.insertSublayer(borderLayer, at: 0)
      return
    }

    //let sides = BorderSides(rawValue: BorderSides)

    if borderSides == .AllSides {
      layer.borderColor = borderColor.cgColor
      layer.borderWidth = borderWidth
      return
    }

    // configure border for specified sides
    let border = CAShapeLayer()
    border.name = "borderSideLayer"

    let borderPath = UIBezierPath()
    let shift = borderWidth / 2
    var lines: [(start: CGPoint, end: CGPoint)] = []
    if borderSides.contains(.top) {
      lines.append((start: CGPoint(x: 0, y: shift), end: CGPoint(x: bounds.size.width, y: shift)))
    }


public protocol BorderDesignable {
  /**
   `bordertype: solid, dash, if not specified, solid will be used
   */
  var borderType: BorderType { get set }

