-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Completion event #20
Completion event #20
Conversation
More generically, are you looking for a completion event to be called when the animation for the view controller you are explicitly telling to display is complete? For example, the right drawer is open, but the center view is still visible. You then call to close the right drawer so the center will become the main view controller (so no |
I'm looking for detect when left or right are become active i.e. finished their transition. "toggleDrawerSide:animated:completion:" method has a block argument which called when transition is finished. In your example this method explicitly called when user press button to open right(left) controller. It's solve a part of the problem. But it's also possible to open left(right) controller with swipe gesture. I want to set the same completion block for swipe gesture. |
Hey @arsenykorotaev, What exactly are you wanting to do in that case? I.e. update a table, display an animation, etc. Still trying to think about what would be the best solution for you. |
I want to setup video capture session. Good scenario:
|
It's almost as if something needs to be called on the view controller that the completion handler is being called for. Almost like the view lifecycle methods ( |
I think this is a good solution. Let me propose this, however. What if instead of the block that you've defined here, we defined a category method on all
This way you wouldn't need to hold onto a block for what happens for a view controller. Each view controller could handle what happens when that gesture is completed, so different actions could be handled by each view controller simultaneously. What are your thoughts on this? |
I'm torn on that one. Not sure I like it. I think it would be better to create a subclass of MMDrawerController, and let that subclass be your air traffic control man by setting that block and manipulating its children appropriately. Thoughts? |
Ok I can see this. Any specific examples I can think of in favor of the category method would be mitigated by use of |
Ya we should put some documentation together on that. I've also been following @steipete's great work here with NS_REQUIRES_SUPER, which would come in handy here as well. |
Yeah I ran into that gist earlier this week and it's intrigued me as I've never seen such an attribute documented before. I'm creating an issue right now to start discussion about subclassing rules and documentation. |
Created #36 to define subclassing procedures. Feel free to add input to make it easier for everyone since we all have different goals as to what this is supposed to do. |
@larsacus What do you think about this pull request for this specific feature? |
I think this looks good for this case. If the developer requires multiple callbacks or to be "air traffic controller", a subclass is in order. I approve. |
Support for a callback block when a gesture event is completed.
Hello!
There is a method:
toggleDrawerSide: animated: completion:
called when user press open button. Within completion block I can detect when it opened up.
The question is: how can I detect it opened when user performed swipe gesture or finished dragging the open button?