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

Adding ModernSearchBar to nav bar #17

Open
stshelton opened this issue Apr 27, 2017 · 3 comments
Open

Adding ModernSearchBar to nav bar #17

stshelton opened this issue Apr 27, 2017 · 3 comments

Comments

@stshelton
Copy link

I added the ModernSearchBar programmatically to the nav bar titleView. The suggestion view is not appearing when "setDatas" is set with suggestions. Is there any way to have suggestion view appear when search bar is in Nav bar or does it need to be in a separate view?

@PhilippeBoisney
Copy link
Owner

Can you provide me some code or snippet to reproduce this issue ?

@stshelton
Copy link
Author

stshelton commented Apr 28, 2017

` //adding search bar

searchBar = ModernSearchBar()
searchBar.sizeToFit()
//searchBar.setImage(#imageLiteral(resourceName: "logo"), for: .search, state: .normal)
navigationItem.titleView = searchBar
searchBar.delegateModernSearchBar = self
searchBar.delegate = self
self.searchBar.setDatas(datas: ["yo", "hello"])`

neither "yo" or "hello" appears in suggestion view when either "y" or "h" is typed in (Suggestionview is not shown). Also adding a cancel button to left nav item when user "begins to edit search bar". I did try without cancel button and still no luck, yet there is a right nav item that i have yet to try without both buttons.

@milika
Copy link

milika commented May 15, 2017

I had the same problem
I had nomal searchBar.delegate set, side by side with searchBar.delegateModernSearchBar

When i removed searchBar.delegate = self everything started working

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

3 participants