-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversation
@@ -305,6 +314,8 @@ open class DrawerController: UIViewController, UIGestureRecognizerDelegate { | |||
/// Golden-Path | |||
guard isEnable() else { return } | |||
guard !isAnimating else { return } | |||
|
|||
delegate?.drawerWillCloseSide?(drawerController: self) |
There was a problem hiding this comment.
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?
Please support Rx delegating. |
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) |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
LGTM
Merged |
No description provided.