         let nib = UINib(nibName: self.nibName(), bundle: bundle)
         return nib.instantiateWithOwner(self, options: nil)[0] as! UIView
     }
-    
+
+    // MARK: - Nib loading
+
     /**
-    Called in the default implementation of loadNib(). Default is class name.
-    
-    - returns: Name of a single view nib file.
+    Called in init(frame:) and init(aDecoder:) to load the nib and add it as a subview.
     */
+    private func setupNib() {
+        let view = self.loadNib()
+        self.nibContainerView.addSubview(view)
+        view.translatesAutoresizingMaskIntoConstraints = false
+        let bindings = ["view": view]
+        self.nibContainerView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
+        self.nibContainerView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
+    }
+}
+
+extension UIView {
+    public var nibContainerView: UIView {
+        get {
+            return self
+        }
+    }
+    /**
+     Called in the default implementation of loadNib(). Default is class name.
+
+     - returns: Name of a single view nib file.
+     */
     public func nibName() -> String {
         return self.dynamicType.description().componentsSeparatedByString(".").last!
     }
 }
 
 @IBDesignable
-public class NibDesignable: UIView {
+public class NibDesignable: UIView, NibDesignableProtocol {
 
     // MARK: - Initializer
     override public init(frame: CGRect) {

        super.init(coder: aDecoder)
        self.setupNib()
    }

    // MARK: - Nib loading

    /**
        Called in init(frame:) and init(aDecoder:) to load the nib and add it as a subview.
    */
    private func setupNib() {
        let view = self.loadNib()
        self.addSubview(view)
        view.translatesAutoresizingMaskIntoConstraints = false
        let bindings = ["view": view]
        self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
        self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
    }
}

@IBDesignable
public class NibDesignableTableViewCell: UITableViewCell {
    
    // MARK: - Initializer
    override public init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setupNib()
    }
    
    // MARK: - NSCoding
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.setupNib()
    }
    
    // MARK: - Nib loading
    
    /**
        Called in init(frame:) and init(aDecoder:) to load the nib and add it as a subview.
    */
    private func setupNib() {
        let view = self.loadNib()
        self.contentView.addSubview(view)
        view.translatesAutoresizingMaskIntoConstraints = false
        let bindings = ["view": view]
        self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
        self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
    }
}

@IBDesignable
public class NibDesignableControl: UIControl {

    // MARK: - Initializer
    override public init(frame: CGRect) {

        super.init(coder: aDecoder)
        self.setupNib()
    }
}

@IBDesignable
public class NibDesignableCollectionViewCell: UICollectionViewCell, NibDesignableProtocol {
    public override var nibContainerView: UIView {
        get {
            return self.contentView
        }
    }

    // MARK: - Initializer
    override public init(frame: CGRect) {
        super.init(frame: frame)
        self.setupNib()
    }

    // MARK: - NSCoding
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.setupNib()
    }
}