     }
     }
     
+    /// avatar image
     @IBInspectable public var avatarImage : UIImage? {
     didSet {
         applyFilter()
     }
     }
     
+    /// avatar vibrance effect amount
     @IBInspectable public var vibranceAmount : CGFloat = 0 {
     didSet {
         applyFilter()

//
//  BMXAvatarView.swift
//  BMXAvatarView
//
//  Created by Massimiliano Bigatti on 08/07/14.
//  Copyright (c) 2014 Massimiliano Bigatti. All rights reserved.
//

import Foundation

@IBDesignable public class AvatarView : UIView {
    
    // MARK: - Private Properties
    
    private var imageView = UIImageView()
    private let activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge)
    
    
    // MARK: - Public Properties
    
    @IBInspectable public var borderWidth : CGFloat = 2 {
    didSet {
        self.layer.borderWidth = borderWidth
    }
    }
    
    @IBInspectable public var borderColor : UIColor = UIColor.clearColor() {
    didSet {
        self.layer.borderColor = borderColor.CGColor

    
    // MARK: - Privates
    
    /**
        Apply vibrancy effect filter showing the activity indicator if required
     */
    private func applyFilter() {
        if (avatarImage == nil) {
            return
