Commit f778d3dc by Daniel Dahan

updated userInteractionEnabled to isUserInteractionEnabled

parent d2cb2d46
...@@ -419,9 +419,9 @@ public class MaterialTableViewCell : UITableViewCell { ...@@ -419,9 +419,9 @@ public class MaterialTableViewCell : UITableViewCell {
selectionStyle = .None selectionStyle = .None
separatorInset = UIEdgeInsetsZero separatorInset = UIEdgeInsetsZero
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
imageView?.userInteractionEnabled = false imageView?.isUserInteractionEnabled = false
textLabel?.userInteractionEnabled = false textLabel?.isUserInteractionEnabled = false
detailTextLabel?.userInteractionEnabled = false detailTextLabel?.isUserInteractionEnabled = false
prepareVisualLayer() prepareVisualLayer()
} }
......
...@@ -59,8 +59,8 @@ public class MenuController : RootController { ...@@ -59,8 +59,8 @@ public class MenuController : RootController {
all menu items have been opened. all menu items have been opened.
*/ */
public func openMenu(completion: (() -> Void)? = nil) { public func openMenu(completion: (() -> Void)? = nil) {
if true == userInteractionEnabled { if true == isUserInteractionEnabled {
userInteractionEnabled = false isUserInteractionEnabled = false
rootViewController.view.alpha = 0.5 rootViewController.view.alpha = 0.5
menuView.open(completion) menuView.open(completion)
} }
...@@ -72,10 +72,10 @@ public class MenuController : RootController { ...@@ -72,10 +72,10 @@ public class MenuController : RootController {
all menu items have been closed. all menu items have been closed.
*/ */
public func closeMenu(completion: (() -> Void)? = nil) { public func closeMenu(completion: (() -> Void)? = nil) {
if false == userInteractionEnabled { if false == isUserInteractionEnabled {
rootViewController.view.alpha = 1 rootViewController.view.alpha = 1
menuView.close({ [weak self] in menuView.close({ [weak self] in
self?.userInteractionEnabled = true self?.isUserInteractionEnabled = true
completion?() completion?()
}) })
} }
......
...@@ -61,11 +61,11 @@ public class MenuView : PulseView { ...@@ -61,11 +61,11 @@ public class MenuView : PulseView {
all menu items have been opened. all menu items have been opened.
*/ */
public func open(completion: (() -> Void)? = nil) { public func open(completion: (() -> Void)? = nil) {
if true == menu.views?.first?.userInteractionEnabled { if true == menu.views?.first?.isUserInteractionEnabled {
menu.views?.first?.userInteractionEnabled = false menu.views?.first?.isUserInteractionEnabled = false
menu.open { [weak self] (v: UIView) in menu.open { [weak self] (v: UIView) in
if self?.menu.views?.last == v { if self?.menu.views?.last == v {
self?.menu.views?.first?.userInteractionEnabled = true self?.menu.views?.first?.isUserInteractionEnabled = true
completion?() completion?()
} }
} }
...@@ -78,11 +78,11 @@ public class MenuView : PulseView { ...@@ -78,11 +78,11 @@ public class MenuView : PulseView {
all menu items have been closed. all menu items have been closed.
*/ */
public func close(completion: (() -> Void)? = nil) { public func close(completion: (() -> Void)? = nil) {
if true == menu.views?.first?.userInteractionEnabled { if true == menu.views?.first?.isUserInteractionEnabled {
menu.views?.first?.userInteractionEnabled = false menu.views?.first?.isUserInteractionEnabled = false
menu.close { [weak self] (v: UIView) in menu.close { [weak self] (v: UIView) in
if self?.menu.views?.last == v { if self?.menu.views?.last == v {
self?.menu.views?.first?.userInteractionEnabled = true self?.menu.views?.first?.isUserInteractionEnabled = true
completion?() completion?()
} }
} }
......
...@@ -608,7 +608,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -608,7 +608,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
if let v: View = leftView { if let v: View = leftView {
hideStatusBar() hideStatusBar()
showView(v) showView(v)
userInteractionEnabled = false isUserInteractionEnabled = false
delegate?.navigationDrawerWillOpen?(self, position: .Left) delegate?.navigationDrawerWillOpen?(self, position: .Left)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { animations: {
...@@ -634,7 +634,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -634,7 +634,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
if let v: View = rightView { if let v: View = rightView {
hideStatusBar() hideStatusBar()
showView(v) showView(v)
userInteractionEnabled = false isUserInteractionEnabled = false
delegate?.navigationDrawerWillOpen?(self, position: .Right) delegate?.navigationDrawerWillOpen?(self, position: .Right)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
...@@ -660,7 +660,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -660,7 +660,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
public func closeLeftView(velocity: CGFloat = 0) { public func closeLeftView(velocity: CGFloat = 0) {
if enabledLeftView { if enabledLeftView {
if let v: View = leftView { if let v: View = leftView {
userInteractionEnabled = true isUserInteractionEnabled = true
delegate?.navigationDrawerWillClose?(self, position: .Left) delegate?.navigationDrawerWillClose?(self, position: .Left)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
...@@ -688,7 +688,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel ...@@ -688,7 +688,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
public func closeRightView(velocity: CGFloat = 0) { public func closeRightView(velocity: CGFloat = 0) {
if enabledRightView { if enabledRightView {
if let v: View = rightView { if let v: View = rightView {
userInteractionEnabled = true isUserInteractionEnabled = true
delegate?.navigationDrawerWillClose?(self, position: .Right) delegate?.navigationDrawerWillClose?(self, position: .Right)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))), UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
animations: { [weak self] in animations: { [weak self] in
......
...@@ -46,12 +46,12 @@ public class RootController : UIViewController { ...@@ -46,12 +46,12 @@ public class RootController : UIViewController {
A Boolean property used to enable and disable interactivity A Boolean property used to enable and disable interactivity
with the rootViewController. with the rootViewController.
*/ */
@IBInspectable public var userInteractionEnabled: Bool { @IBInspectable public var isUserInteractionEnabled: Bool {
get { get {
return rootViewController.view.userInteractionEnabled return rootViewController.view.isUserInteractionEnabled
} }
set(value) { set(value) {
rootViewController.view.userInteractionEnabled = value rootViewController.view.isUserInteractionEnabled = value
} }
} }
...@@ -77,7 +77,7 @@ public class RootController : UIViewController { ...@@ -77,7 +77,7 @@ public class RootController : UIViewController {
- Parameter nibNameOrNil: An Optional String for the nib. - Parameter nibNameOrNil: An Optional String for the nib.
- Parameter bundle: An Optional NSBundle where the nib is located. - Parameter bundle: An Optional NSBundle where the nib is located.
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView() prepareView()
} }
......
...@@ -98,8 +98,8 @@ public class ToolbarController : RootController { ...@@ -98,8 +98,8 @@ public class ToolbarController : RootController {
v.view.removeFromSuperview() v.view.removeFromSuperview()
v.removeFromParentViewController() v.removeFromParentViewController()
v.view.layer.shouldRasterize = false v.view.layer.shouldRasterize = false
s.userInteractionEnabled = true s.isUserInteractionEnabled = true
s.toolbar.userInteractionEnabled = true s.toolbar.isUserInteractionEnabled = true
dispatch_async(dispatch_get_main_queue()) { [weak self] in dispatch_async(dispatch_get_main_queue()) { [weak self] in
if let s: ToolbarController = self { if let s: ToolbarController = self {
s.delegate?.toolbarControllerDidCloseFloatingViewController?(s) s.delegate?.toolbarControllerDidCloseFloatingViewController?(s)
...@@ -126,8 +126,8 @@ public class ToolbarController : RootController { ...@@ -126,8 +126,8 @@ public class ToolbarController : RootController {
view.layer.rasterizationScale = Device.scale view.layer.rasterizationScale = Device.scale
view.layer.shouldRasterize = true view.layer.shouldRasterize = true
internalFloatingViewController = v internalFloatingViewController = v
userInteractionEnabled = false isUserInteractionEnabled = false
toolbar.userInteractionEnabled = false toolbar.isUserInteractionEnabled = false
delegate?.toolbarControllerWillOpenFloatingViewController?(self) delegate?.toolbarControllerWillOpenFloatingViewController?(self)
UIView.animateWithDuration(0.5, UIView.animateWithDuration(0.5,
animations: { [weak self] in animations: { [weak self] in
......
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