         super.init(coder: aDecoder)
         self.cornerRadius = 3.0
     }
-    
-}
-
-extension CGRect {
-    var center:CGPoint {
-        return CGPointMake(CGRectGetMidX(self), CGRectGetMidY(self));
-    }
-    
-    static func rectCenteredOn(center:CGPoint, radius:CGFloat) -> CGRect {
-        return CGRectMake(floor(center.x - radius), floor(center.y - radius), floor(radius*2.0), floor(radius*2.0))
-    }
 }
 
 class RoundImageView: UIImageView {
+    
+    let circlePathLayer = CAShapeLayer()
+
+    var borderColor:UIColor = UIColor.blackColor() {
+        didSet {
+            layer.borderColor = borderColor.CGColor
+        }
+    }
     
     func makeRound() {
         let minDimension:CGFloat = min(self.bounds.width, self.bounds.height)

        layer.cornerRadius = minDimension/2.0
        
        layer.borderWidth = 2.0
        layer.borderColor = UIColor.blackColor().CGColor
    }
    
    override func layoutSubviews() {

    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        configure()
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        configure()
    }
    
    func configure() {
        makeRound()
        
        circlePathLayer.frame = bounds
        circlePathLayer.lineWidth = 2.0
        circlePathLayer.fillColor = UIColor.clearColor().CGColor
        circlePathLayer.strokeColor = UIColor.blackColor().CGColor
        layer.addSublayer(circlePathLayer)
    }    
}