             
             case .Hidden:
                 delegate?.splitViewController?(self, willHideMasterViewController: master)
-                master.view.removeFromSuperview()
-                overlayHideButton?.removeFromSuperview()
+                if overlayHideButton == nil {
+                    master.view.removeFromSuperview()
+                } else {
+                    animateOutMasterViewControllerOverlay()
+                    overlayHideButton = nil
+                }
 
             case .Showing:
                 delegate?.splitViewController?(self, willShowMasterViewController: master)
                 if master.view.superview !== view {
                     view.addSubview(master.view)
                 }
-                overlayHideButton?.removeFromSuperview()
+                overlayHideButton = nil
 
             case .Overlay:
                 if master.view.superview !== view {
                     view.addSubview(master.view)
+                    animateInMasterViewControllerOverlay()
                 }
             }
             

        }
    }
    
    func overlayHideButtonTapped() {
        guard masterPresentationStyle == .Overlay else {
            return

        }
    }
    
    private var overlayHideButton: UIButton? {
        willSet(newValue) {
            if newValue == nil {
                overlayHideButton?.removeFromSuperview()
            }
        }
    }
    
    private enum MasterPresentationStyle {
        case Hidden
