Commit 2ddcda01 by Daniel Dahan

update SideNavigationViewController API

parent 03e724c4
...@@ -58,10 +58,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -58,10 +58,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
return 0 == NSBundle.mainBundle().objectForInfoDictionaryKey("UIViewControllerBasedStatusBarAppearance") as? Int return 0 == NSBundle.mainBundle().objectForInfoDictionaryKey("UIViewControllerBasedStatusBarAppearance") as? Int
} }
// /**
// :name: isUserInteractionEnabled :name: userInteractionEnabled
// */
internal var isUserInteractionEnabled: Bool { public var userInteractionEnabled: Bool {
get { get {
return mainViewController!.view.userInteractionEnabled return mainViewController!.view.userInteractionEnabled
} }
...@@ -199,12 +199,12 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -199,12 +199,12 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
let h: CGFloat = vc.height let h: CGFloat = vc.height
let d: Double = Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(vc.x / velocity)))) let d: Double = Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(vc.x / velocity))))
toggleStatusBar(true)
MaterialAnimation.animationWithDuration(d, animations: { MaterialAnimation.animationWithDuration(d, animations: {
vc.position = CGPointMake(w / 2, h / 2) vc.position = CGPointMake(w / 2, h / 2)
self.backdropLayer.hidden = false self.backdropLayer.hidden = false
}) { }) {
self.isUserInteractionEnabled = false self.userInteractionEnabled = false
self.toggleStatusBar(true)
} }
} }
} }
...@@ -218,12 +218,12 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -218,12 +218,12 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
let h: CGFloat = vc.height let h: CGFloat = vc.height
let d: Double = Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(vc.x / velocity)))) let d: Double = Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(vc.x / velocity))))
toggleStatusBar(false)
MaterialAnimation.animationWithDuration(d, animations: { MaterialAnimation.animationWithDuration(d, animations: {
vc.position = CGPointMake(-w / 2, h / 2) vc.position = CGPointMake(-w / 2, h / 2)
self.backdropLayer.hidden = true self.backdropLayer.hidden = true
}) { }) {
self.isUserInteractionEnabled = true self.userInteractionEnabled = true
self.toggleStatusBar(false)
} }
} }
} }
...@@ -270,7 +270,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -270,7 +270,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
MaterialAnimation.animationDisabled({ MaterialAnimation.animationDisabled({
self.leftView!.position = CGPointMake(-self.leftView!.width / 2, self.leftView!.height / 2) self.leftView!.position = CGPointMake(-self.leftView!.width / 2, self.leftView!.height / 2)
self.leftView!.zPosition = 1000 self.leftView!.zPosition = 1000
self.leftView!.masksToBounds = true
}) })
prepareViewControllerWithinContainer(leftViewController!, container: leftView!) prepareViewControllerWithinContainer(leftViewController!, container: leftView!)
......
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