 
         self.addConstraints([
             centerXConstraint,
-            centerYConstraint,
+            self.centerYConstraint,
             widthConstraint,
             heightConstraint]
         )

        return view
    }
    
    internal func presentationAnimations() {
        UIView.animateWithDuration(0.3) {
            self.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
        }
    }
    
}


            constant: 0
        )
        mainWindow.addConstraints([topConstraint,bottomConstraint,leftConstraint,rightConstraint])
        //create black layer
        self.blackLayer = UIView()
        self.blackLayer.backgroundColor = UIColor.clearColor()
        self.addSubview(blackLayer)
        self.blackLayer.translatesAutoresizingMaskIntoConstraints = false
        //set black layer layout
        let topLayerConstraint = NSLayoutConstraint(
            item: self.blackLayer,
            attribute: .Top,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Top,
            multiplier: 1,
            constant: 0
        )
        let bottomLayerConstraint = NSLayoutConstraint(
            item: self.blackLayer,
            attribute: .Bottom,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Bottom,
            multiplier: 1,
            constant: 0
        )
        let leftLayerConstraint = NSLayoutConstraint(
            item: self.blackLayer,
            attribute: .Left,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Left,
            multiplier: 1,
            constant: 0
        )
        let rightLayerConstraint = NSLayoutConstraint(
            item: self.blackLayer,
            attribute: .Right,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Right,
            multiplier: 1,
            constant: 0
        )
        self.addConstraints([topLayerConstraint,bottomLayerConstraint,leftLayerConstraint,rightLayerConstraint])
        //add tap gesture to layer
        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.handleTap))
        self.blackLayer.addGestureRecognizer(tapGesture)
        //load calendar view
        self.calendar = loadViewFromNib()
        self.calendar.alpha = 0
        self.calendar.translatesAutoresizingMaskIntoConstraints = false
        self.addSubview(self.calendar)
        //set calendar view layout
