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

pressedCancelButton resigns always without respecting the delegate #19

Open
Blackjacx opened this issue Apr 27, 2017 · 0 comments
Open
Labels

Comments

@Blackjacx
Copy link
Owner

Current implementation:

func pressedCancelButton(_ sender: AnyObject) {
        textField.resignFirstResponder()
        _ = delegate?.searchBarShouldCancel?(self)
}

Better implementation:

func pressedCancelButton(_ sender: AnyObject) {
	if delegate?.searchBarShouldCancel?(self) ?? true {
		textField.resignFirstResponder()
	}
}
@Blackjacx Blackjacx added this to the 1.1.1 milestone Apr 27, 2017
@Blackjacx Blackjacx added the bug label Apr 27, 2017
@Blackjacx Blackjacx removed this from the 1.4.0 milestone Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant