         self.addSubview(subView!);
     }
     
-    public func addSubviewAtCenterHorizontally(subView: UIView?, originY: CGFloat?)
+    
+    
+    
+    /**
+    * Shortcut to add subview at center of view horizontally
+    */
+    public func addSubviewAtCenterHorizontally(subView: UIView?, originY: CGFloat)
     {
         if (subView == nil)
         {


public extension UIView
{
    public var origin:CGPoint{get{return self.frame.origin}}
    public var size:CGSize{get{return self.frame.size}}
    
    public var endX:CGFloat{get{return self.frame.origin.x + self.frame.size.width}}
    public var endY:CGFloat{get{return self.frame.origin.y + self.frame.size.height}}
    
    public func addSubviewAtCenter(subView: UIView?)
    {
        if (subView == nil)

        
        var subViewFrame = subView!.frame;
        subViewFrame.origin.x = self.size.width / 2 - subViewFrame.size.width / 2;
        subViewFrame.origin.y = originY;
        subView!.frame = subViewFrame;
        self.addSubview(subView!);
    }
