Commit 697bc98a by Daniel Dahan

updated SideNavigationViewController to utilize alpha for backdrop animation

parent 1fc64c08
...@@ -52,14 +52,12 @@ class AppMenuViewController: MenuViewController { ...@@ -52,14 +52,12 @@ class AppMenuViewController: MenuViewController {
override func openMenu(completion: (() -> Void)? = nil) { override func openMenu(completion: (() -> Void)? = nil) {
super.openMenu(completion) super.openMenu(completion)
sideNavigationViewController?.enabled = false sideNavigationViewController?.enabled = false
mainViewController.view.alpha = 0.5
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(0.125)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(0.125))
} }
override func closeMenu(completion: (() -> Void)? = nil) { override func closeMenu(completion: (() -> Void)? = nil) {
super.closeMenu(completion) super.closeMenu(completion)
sideNavigationViewController?.enabled = true sideNavigationViewController?.enabled = true
mainViewController.view.alpha = 1
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(-0.125)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(-0.125))
} }
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.34.10' s.version = '1.35.0'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -378,8 +378,8 @@ ...@@ -378,8 +378,8 @@
96442ADC1C28EF1400C3C574 /* TableView */, 96442ADC1C28EF1400C3C574 /* TableView */,
96CC08891C7FEBE10034FF84 /* CollectionView */, 96CC08891C7FEBE10034FF84 /* CollectionView */,
965C58BD1C6B8D3300CFB4E1 /* Grid */, 965C58BD1C6B8D3300CFB4E1 /* Grid */,
96A71E921C6FBC2900C0C4AE /* Menu */,
96A71EC51C6FFEF300C0C4AE /* Switch */, 96A71EC51C6FFEF300C0C4AE /* Switch */,
96A71E921C6FBC2900C0C4AE /* Menu */,
96CC08561C7E0EC00034FF84 /* ControlView */, 96CC08561C7E0EC00034FF84 /* ControlView */,
96D88C541C132A7700B91418 /* StatusBar */, 96D88C541C132A7700B91418 /* StatusBar */,
9626C2DB1C794FBB007CA8E0 /* SearchBar */, 9626C2DB1C794FBB007CA8E0 /* SearchBar */,
......
...@@ -129,10 +129,9 @@ public class MenuViewController: UIViewController { ...@@ -129,10 +129,9 @@ public class MenuViewController: UIViewController {
*/ */
public func openMenu(completion: (() -> Void)? = nil) { public func openMenu(completion: (() -> Void)? = nil) {
if true == userInteractionEnabled { if true == userInteractionEnabled {
menuView.open { [weak self] in userInteractionEnabled = false
self?.userInteractionEnabled = false mainViewController.view.alpha = 0.5
completion?() menuView.open(completion)
}
} }
} }
...@@ -143,10 +142,9 @@ public class MenuViewController: UIViewController { ...@@ -143,10 +142,9 @@ public class MenuViewController: UIViewController {
*/ */
public func closeMenu(completion: (() -> Void)? = nil) { public func closeMenu(completion: (() -> Void)? = nil) {
if false == userInteractionEnabled { if false == userInteractionEnabled {
menuView.close { [weak self] in userInteractionEnabled = true
self?.userInteractionEnabled = true mainViewController.view.alpha = 1
completion?() menuView.close(completion)
}
} }
} }
......
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