Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add state methods to delegate #16

Merged
merged 11 commits into from
Feb 13, 2018

Conversation

0xch4z
Copy link
Contributor

@0xch4z 0xch4z commented Feb 13, 2018

No description provided.

@@ -305,6 +314,8 @@ open class DrawerController: UIViewController, UIGestureRecognizerDelegate {
/// Golden-Path
guard isEnable() else { return }
guard !isAnimating else { return }

delegate?.drawerWillCloseSide?(drawerController: self)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you pass this state using the self.drawerSide value?

@kawoou
Copy link
Owner

kawoou commented Feb 13, 2018

Please support Rx delegating.

@0xch4z
Copy link
Contributor Author

0xch4z commented Feb 13, 2018

Ah, forgot about Rx. Just pushed it

@@ -358,7 +358,7 @@ open class DrawerController: UIViewController, UIGestureRecognizerDelegate {
ss.didFinishAnimate(side: .none, percent: 0.0)

ss.isAnimating = false
ss.delegate?.drawerDidCloseSide?(drawerController: ss)
ss.delegate?.drawerDidCloseSide?(drawerController: ss, side: ss.drawerSide)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not write oldValue, there is likely to be some variation in the middle.

let oldDrawerSide = drawerSide

delegate?.drawerWillCloseSide?(drawerController: self, side: oldDrawerSide)

...

ss.delegate?.drawerDidCloseSide?(drawerController: ss, side: oldDrawerSide)

...


return ControlEvent(events: source)
}
public var didCloseSide: ControlEvent<DrawerSide> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@0xch4z
Copy link
Contributor Author

0xch4z commented Feb 13, 2018

Updated

@kawoou kawoou changed the base branch from master to develop February 13, 2018 10:47
Copy link
Owner

@kawoou kawoou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
LGTM

@kawoou kawoou merged commit 8bd6145 into kawoou:develop Feb 13, 2018
@kawoou
Copy link
Owner

kawoou commented Feb 13, 2018

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants