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

点击取消时,可以改变 dismiss 的动画吗 #35

Closed
Huang-Libo opened this issue Dec 22, 2016 · 2 comments
Closed

点击取消时,可以改变 dismiss 的动画吗 #35

Huang-Libo opened this issue Dec 22, 2016 · 2 comments

Comments

@Huang-Libo
Copy link

Huang-Libo commented Dec 22, 2016

一般情况下,在进入和退出一个页面的时候,都会设置动画,不然会显得比较突兀。我看了 PYSearch 对点击取消的处理,是直接设定好了 dismiss 的方式,是没有动画的,我建议让增加参数来设置 dismiss 的方式(包括是否有动画,以及动画的方式),这样可能会更灵活。

/** 点击取消 */
- (void)cancelDidClick
{
    [self.searchBar resignFirstResponder];
    
    // dismiss ViewController
    [self dismissViewControllerAnimated:NO completion:nil];
    
    // 调用代理方法
    if ([self.delegate respondsToSelector:@selector(didClickCancel:)]) {
        [self.delegate didClickCancel:self];
    }
}
@Huang-Libo Huang-Libo changed the title 点击取消时,可以改变 dismiss 的方式吗 点击取消时,可以改变 dismiss 的动画吗 Dec 22, 2016
@ko1o
Copy link
Owner

ko1o commented Dec 22, 2016

@Huang-Libo 谢谢您的建议,是的,我觉得应该让用户自己实现显示和消失!如果用户没有实现,默认为dismiss才对

@ko1o
Copy link
Owner

ko1o commented Dec 22, 2016

@Huang-Libo 现在已经支持用户自定义searchViewController的消失了,欢迎下载最新版测试,或者执行pod update!

@ko1o ko1o closed this as completed Dec 22, 2016
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

No branches or pull requests

2 participants