     override func viewWillAppear(animated: Bool) {
         super.viewWillAppear(animated)
         NSNotificationCenter.defaultCenter().addObserver(self, selector:Selector("didRotate:"), name:"UIDeviceOrientationDidChangeNotification" , object:nil)
-        updateButtonConstraint()
     }
     
     override func viewWillDisappear(animated: Bool) {

        currentController?.view.frame = UIScreen.mainScreen().bounds
        currentController?.view.transform  = CGAffineTransformScale(CGAffineTransformIdentity, 0.6, 0.6)
        
        if containerViewWidthConstraint != nil {
            if !slideContainerView {
                containerViewWidthConstraint.constant = UIScreen.mainScreen().bounds.width + 20
                view.layoutIfNeeded()
            }
        } else {
            updateFrames()
        }
        
        updateButtonConstraint()
        
        tableView.setContentOffset(CGPointMake(0, 0), animated: false)
    }
    
    // MARK: - Update frames and constraints methods
    
    @objc private func updateButtonConstraint () {
        if buttonOriginYConstraint != nil {
            originalbuttonOriginY = 26
            if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
                switch UIDevice.currentDevice().orientation {
                case .Portrait:
                    break
                    
                case .FaceDown, .FaceUp:
                    originalbuttonOriginY = buttonOriginYConstraint.constant
                    
                default:
                    originalbuttonOriginY = 0
                }
            }
            buttonOriginYConstraint.constant = originalbuttonOriginY!
            view.layoutIfNeeded()
        }
    }

    @objc private func updateFrames () {
        var closeButtonOriginY:CGFloat = 26
        var tableViewFrameY:CGFloat = 55
        if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
            switch UIDevice.currentDevice().orientation {
            case .Portrait:
                break
                
            case .FaceDown, .FaceUp:
                closeButtonOriginY = originalCloseButtonFrame?.origin.y as CGFloat!
                tableViewFrameY = originalTableViewFrame?.origin.y as CGFloat!
                
            default:
                closeButtonOriginY = 0
                tableViewFrameY = 30
            }
        }
        
        //updating closeButton frame
        closeButton.frame = CGRectMake(UIDevice.currentDevice().userInterfaceIdiom == .Phone ? 13 : 17, closeButtonOriginY, 30, 30)
        originalCloseButtonFrame = closeButton.frame
        
        //updating containerView frame
        if slideContainerView {
            containerView.frame = CGRectMake(0, 0, doneAnimations ? maxContainerViewWidth : minContainerViewWidth, UIScreen.mainScreen().bounds.size.height)
        } else {
            containerView.frame = UIScreen.mainScreen().bounds
        }
        
        //updating blurEffectView frame
        blurEffectView.frame = UIScreen.mainScreen().bounds
        
        //updating tableView frame
        tableView.frame =  CGRectMake(0, tableViewFrameY, containerView.frame.width, containerView.frame.height)
        originalTableViewFrame = tableView.frame
    }

    // MARK: - Show & Close menu

                }) { (finished) -> Void in
                    self.view.alpha = 0
                    navigationController.presentViewController(self, animated:false, completion: { () -> Void in
                        self.updateFrames()
                        UIView.animateWithDuration(0.35, delay:0.0, options:.CurveEaseInOut, animations: { () -> Void in
                            self.view.alpha = 1.0
                            self.doneAnimations = true
                            self.updateFrames()
                            self.tableView.reloadData()
                            }, completion: { (finished) -> Void in
                                self.doneCellAnimations = true
