//在初始化调用这个方法
func addshapeLayer(){
shapeLayer = CAShapeLayer(layer:layer)
borderLabel.layer.addSublayer(shapeLayer)
}
//添加时候 调用这个方法
func draswTopDsline(lineLab:UILabel,lineLength:CGFloat,lineSpaceing:CGFloat) {
shapeLayer.bounds = lineLab.bounds
shapeLayer.position = CGPointMake(CGRectGetWidth(lineLab.frame)/2,CGRectGetHeight(lineLab.frame)/2)
shapeLayer.fillColor = UIColor.clearColor().CGColor
shapeLayer.strokeColor = ColorValue.color_9.CGColor
shapeLayer.lineWidth = 1.0
shapeLayer.lineJoin = kCALineJoinRound
let array:[NSNumber] = [lineLength,lineLength,0]
shapeLayer.lineDashPattern = array
//上
let path = CGPathCreateMutable()
CGPathMoveToPoint(path, nil, 0,0)
CGPathAddLineToPoint(path, nil,CGRectGetWidth(lineLab.frame), 0)
//下
CGPathMoveToPoint(path,nil , 0, CGRectGetHeight(lineLab.frame))
CGPathAddLineToPoint(path, nil, CGRectGetWidth(lineLab.frame),CGRectGetHeight(lineLab.frame))
//左
CGPathMoveToPoint(path, nil, 0, 0)
CGPathAddLineToPoint(path, nil, 0, CGRectGetHeight(lineLab.frame))
//右
CGPathMoveToPoint(path, nil, CGRectGetWidth(lineLab.frame), 0)
CGPathAddLineToPoint(path, nil, CGRectGetWidth(lineLab.frame), CGRectGetHeight(lineLab.frame))
shapeLayer.path = path
}