Commit bb66bcd0 by Daniel Dahan

development: prepared MenuController for release of 2.4.2

parent 33bd6c0f
...@@ -49,8 +49,6 @@ extension UIViewController { ...@@ -49,8 +49,6 @@ extension UIViewController {
} }
open class MenuController: RootController { open class MenuController: RootController {
open fileprivate(set) var blurView: UIView?
/// Reference to the MenuView. /// Reference to the MenuView.
@IBInspectable @IBInspectable
open let menu = Menu() open let menu = Menu()
...@@ -90,21 +88,12 @@ extension MenuController { ...@@ -90,21 +88,12 @@ extension MenuController {
open func openMenu(completion: ((UIView) -> Void)? = nil) { open func openMenu(completion: ((UIView) -> Void)? = nil) {
if true == isUserInteractionEnabled { if true == isUserInteractionEnabled {
isUserInteractionEnabled = false isUserInteractionEnabled = false
UIView.animate(withDuration: 0.15, animations: { [weak self] in
if nil == blurView { guard let s = self else {
let blur = UIVisualEffectView(effect: UIBlurEffect(style: .light)) return
blurView = UIView()
blurView?.layout(blur).edges()
view.layout(blurView!).edges()
view.bringSubview(toFront: menu)
} }
s.rootViewController.view.alpha = 0.15
// UIView.animate(withDuration: 0.15, animations: { [weak self] in })
// guard let s = self else {
// return
// }
// s.rootViewController.view.alpha = 0.15
// })
menu.open { [completion = completion] (view) in menu.open { [completion = completion] (view) in
completion?(view) completion?(view)
} }
...@@ -118,16 +107,12 @@ extension MenuController { ...@@ -118,16 +107,12 @@ extension MenuController {
*/ */
open func closeMenu(completion: ((UIView) -> Void)? = nil) { open func closeMenu(completion: ((UIView) -> Void)? = nil) {
if false == isUserInteractionEnabled { if false == isUserInteractionEnabled {
blurView?.removeFromSuperview() UIView.animate(withDuration: 0.15, animations: { [weak self] in
blurView = nil guard let s = self else {
return
}
// UIView.animate(withDuration: 0.15, animations: { [weak self] in s.rootViewController.view.alpha = 1
// guard let s = self else { })
// return
// }
// s.rootViewController.view.alpha = 1
// })
menu.close { [weak self] (view) in menu.close { [weak self] (view) in
guard let s = self else { guard let s = self else {
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment