Commit bb66bcd0 by Daniel Dahan

development: prepared MenuController for release of 2.4.2

parent 33bd6c0f
......@@ -49,8 +49,6 @@ extension UIViewController {
}
open class MenuController: RootController {
open fileprivate(set) var blurView: UIView?
/// Reference to the MenuView.
@IBInspectable
open let menu = Menu()
......@@ -90,21 +88,12 @@ extension MenuController {
open func openMenu(completion: ((UIView) -> Void)? = nil) {
if true == isUserInteractionEnabled {
isUserInteractionEnabled = false
if nil == blurView {
let blur = UIVisualEffectView(effect: UIBlurEffect(style: .light))
blurView = UIView()
blurView?.layout(blur).edges()
view.layout(blurView!).edges()
view.bringSubview(toFront: menu)
UIView.animate(withDuration: 0.15, animations: { [weak self] in
guard let s = self else {
return
}
// UIView.animate(withDuration: 0.15, animations: { [weak self] in
// guard let s = self else {
// return
// }
// s.rootViewController.view.alpha = 0.15
// })
s.rootViewController.view.alpha = 0.15
})
menu.open { [completion = completion] (view) in
completion?(view)
}
......@@ -118,16 +107,12 @@ extension MenuController {
*/
open func closeMenu(completion: ((UIView) -> Void)? = nil) {
if false == isUserInteractionEnabled {
blurView?.removeFromSuperview()
blurView = nil
// UIView.animate(withDuration: 0.15, animations: { [weak self] in
// guard let s = self else {
// return
// }
// s.rootViewController.view.alpha = 1
// })
UIView.animate(withDuration: 0.15, animations: { [weak self] in
guard let s = self else {
return
}
s.rootViewController.view.alpha = 1
})
menu.close { [weak self] (view) in
guard let s = self else {
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