-
Notifications
You must be signed in to change notification settings - Fork 204
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
如何区分 关闭类型 #157
Comments
??? 按钮的回调不会不触发的呀 |
按钮的回调就不触发了,每次回调的都是 LeeCloseComplete 这个了,我又封装了一层
.LeeCloseComplete(^{ |
这是来自Demo的代码, 你可以试试 打印是正常的... 值得注意的是 LeeCloseComplete回调会先于action的回调
|
是的 问题就在于此,我想要 区分出来,点击背景关闭和点击按钮处理不同的方法,但是现在点击按钮后,会触发两次回调 |
我提供一个思路 方法内提供一个局部block变量, 这个block内调用completion(), 然后按钮回调和关闭回调调用这个block变量, 只要有一方调用了这个block变量 接下来就置空它, 另一个就调用不到了, 你可以将关闭回调的调用async一下 这样就变成了按钮回调优先. |
这样就可以区分是按 钮点击关闭 还是 其他原因关闭 了 |
.LeeAddAction(^(LEEAction *action) {
action.clickBlock = ^{
.LeeCloseComplete(^{
// 关闭回调事件
现在有这个问题,如果添加了下面的关闭回调事件,就不能触发 按钮的回调方法了,这样我就区分不了是点击背景关闭,还是点击按钮事件
The text was updated successfully, but these errors were encountered: