   
   let margin = CGFloat(10.0)
   let labelName = UILabel()
-  let imageView = UIImageView()
+  // let imageView = UIImageView()
+  var layerMaskAvatar = CAShapeLayer()
   let layerGradient = CAGradientLayer()
   
   let strokeColor = UIColor(red:1,  green:1,  blue:1, alpha:1)

    let labelNameBottomY = NSLayoutConstraint(item: labelName, attribute: .Bottom, relatedBy: .Equal, toItem: self, attribute: .Bottom, multiplier: 1, constant: 0)
    NSLayoutConstraint.activateConstraints([labelNameCenterX, labelNameBottomY])

    let imageViewCenterX = NSLayoutConstraint(item: imageView, attribute: .CenterX, relatedBy: .Equal, toItem: self, attribute: .CenterX, multiplier: 1, constant: 0)
    let imageViewTopY = NSLayoutConstraint(item: imageView, attribute: .Top, relatedBy: .Equal, toItem: self, attribute: .Top, multiplier: 1, constant: margin)
    let imageViewBottomY = NSLayoutConstraint(item: imageView, attribute: .Bottom, relatedBy: .Equal, toItem: labelName, attribute: .Top, multiplier: 1, constant: -margin)
    let imageViewWidth = NSLayoutConstraint(item: imageView, attribute: .Width, relatedBy: .Equal, toItem: imageView, attribute: .Height, multiplier: 1, constant: 0)
    NSLayoutConstraint.activateConstraints([imageViewCenterX, imageViewTopY, imageViewBottomY, imageViewWidth])

  }
  
  func configure() {
    
    // Configure image view
    imageView.image = imageAvatar
    layerGradient.colors = [startColor.CGColor, endColor.CGColor]
    layerGradient.startPoint = CGPoint(x: 0.5, y: 0)
    layerGradient.endPoint = CGPoint(x: 0.5, y: 1)
    
    
  }
  

    layer.addSublayer(layerGradient)

    // Setup image view
/*    imageView.layer.borderColor = strokeColor.CGColor
    imageView.layer.borderWidth = 2.75
    imageView.layer.masksToBounds = true
    
    imageView.contentMode = .ScaleAspectFit
    imageView.translatesAutoresizingMaskIntoConstraints = false
    addSubview(imageView)*/
    layerMaskAvatar.fillColor = UIColor.clearColor().CGColor
    layerMaskAvatar.lineWidth = 10
    layerMaskAvatar.contentsGravity = kCAGravityResizeAspectFill
    self.layer.addSublayer(layerMaskAvatar)
    
    
    // Setup label
    labelName.font = UIFont(name: "AvenirNext-Bold", size: 26.0)
