philippeboisney / modernsearchbar Goto Github PK
View Code? Open in Web Editor NEWThe famous iOS search bar with auto completion feature implemented.
License: Other
The famous iOS search bar with auto completion feature implemented.
License: Other
Hi trying to use this with Firebase. I am using the withURL option but nothing shows when i search. The data is pulling from firebase.
I have a UISearchBar roughly in the middle of the page vertically. On clicking, it goes to the top of the screen. However, the SuggestionsListView of ModernSearchBar doesn't shift up and remains in its original position. Which section could be changed to update the position of the suggestions list if the the UISearchBar is moved? Thanks in advance!
I just want UI like ModernSearchbar .
I have tried alot to customise my UISearchbar but I am not able to do so .
Please help me its a bit urgent !
Well i have tried using your great library, but unfortunately it's crash.
i found out you calling this method
private func updateSizeSuggestionsView(){
var frame: CGRect = self.suggestionsView.frame // suggestionView is nil
before setting up the suggestionView.
I have tried to download your example project and it's crash as well :-/
##- OBS 1
private func updateSizeSuggestionsView(){
var frame: CGRect = self.suggestionsView.frame
frame.size.height = self.getExactMaxHeightSuggestionsView(newHeight: self.suggestionsView.contentSize.height)
UIView.animate(withDuration: 0.3) {
self.suggestionsView.frame = frame
self.suggestionsView.layoutIfNeeded()
self.suggestionsView.sizeToFit()
}
}
private func updateSizeSuggestionsView(){
if(suggestionsView != nil){
var frame: CGRect = self.suggestionsView.frame
frame.size.height = self.getExactMaxHeightSuggestionsView(newHeight: self.suggestionsView.contentSize.height)
UIView.animate(withDuration: 0.3) {
self.suggestionsView.frame = frame
self.suggestionsView.layoutIfNeeded()
self.suggestionsView.sizeToFit()
}
}
}
##- OBS 1
private func clearCacheOfList(){
///Clearing cache
for suggestionItem in self.suggestionListWithUrl {
suggestionItem.imgCache = nil
}
///Clearing cache
for suggestionItem in self.suggestionListWithUrlFiltred {
suggestionItem.imgCache = nil
}
self.suggestionsView.reloadData()
}
private func clearCacheOfList(){
///Clearing cache
for suggestionItem in self.suggestionListWithUrl {
suggestionItem.imgCache = nil
}
///Clearing cache
for suggestionItem in self.suggestionListWithUrlFiltred {
suggestionItem.imgCache = nil
}
//Veja que foi adicionado um if para evitar objeto nulo
if(suggestionsView != nil){
self.suggestionsView.reloadData()
}
}
Hi the searchBar seems not assuming the custom values or anything but i don't have any error or warning.
My code and storyboard:
My setup:
class MyViewController: ModernSearchBarDelegate{
@IBOutlet weak var searchBar: ModernSearchBar!
override func viewDidLoad() {
super.viewDidLoad()
self.searchBar.delegateModernSearchBar = self
var suggestionList = Array<String>()
suggestionList.append("Onions")
suggestionList.append("Celery")
self.searchBar.setDatas(datas: suggestionList)
//Modify shadows alpha
self.searchBar.shadowView_alpha = 0.8
//Modify the default icon of suggestionsView's rows
self.searchBar.searchImage = ModernSearchBarIcon.Icon.none.image
//Modify properties of the searchLabel
self.searchBar.searchLabel_font = UIFont(name: "Avenir-Light", size: 30)
self.searchBar.searchLabel_textColor = UIColor.red
self.searchBar.searchLabel_backgroundColor = UIColor.black
//Modify properties of the searchIcon
self.searchBar.suggestionsView_searchIcon_height = 40
self.searchBar.suggestionsView_searchIcon_width = 40
self.searchBar.suggestionsView_searchIcon_isRound = false
//Modify properties of suggestionsView
///Modify the max height of the suggestionsView
self.searchBar.suggestionsView_maxHeight = 1000
///Modify properties of the suggestionsView
self.searchBar.suggestionsView_backgroundColor = UIColor.brown
self.searchBar.suggestionsView_contentViewColor = UIColor.yellow
self.searchBar.suggestionsView_separatorStyle = .singleLine
self.searchBar.suggestionsView_selectionStyle = UITableViewCellSelectionStyle.gray
self.searchBar.suggestionsView_verticalSpaceWithSearchBar = 10
self.searchBar.suggestionsView_spaceWithKeyboard = 20
}
I can't figure out whats happening.
Thanks in advance
There are many errors in Swift 4.2โฆ Can you look at it? Thanks!
Here are the errors:
UITableViewCellSeparatorStyle
has been renamed to UITableViewCell.SeparatorStyle
UITableViewCellSelectionStyle
has been renamed to UITableViewCell.SelectionStyle
UITableViewAutomaticDimension
has been renamed to UITableView.automaticDimension
UIKeyboardWillShow
has been renamed to UIResponder.keyboardWillShowNotification
UIKeyboardWillHide
has been renamed to UIResponder.keyboardWillHideNotification
UIKeyboardFrameEndUserInfoKey
has been renamed to UIResponder.keyboardFrameEndUserInfoKey
UIApplicationDidReceiveMemoryWarning
has been renamed to UIApplication.didReceiveMemoryWarningNotification
UITableViewCellStyle
has been renamed to UITableViewCell.CellStyle
Hi, how can I fix this bug?
https://youtu.be/AUuMXAG7txU
Thanks
I have tried using this library - runs great on the emulator.
Tried pushing it to the phone and I get this:
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
This is inside the ModernSearchBarIcon.swift
private func getImageFromBundle(name: String) -> UIImage { let podBundle = Bundle(for: ModernSearchBarIcon.self) if let url = podBundle.url(forResource: "ModernSearchBar", withExtension: "bundle") { let bundle = Bundle(url: url) return UIImage(named: name, in: bundle, compatibleWith: nil)! } return UIImage() }
Gives out the error at "return UIImage(named: name, in: bundle, compatibleWith: nil)!
"
Any resolution??
Hi, how can I fix this bug?
https://youtu.be/AUuMXAG7txU
Thanks
Sometime, when user typing quickly on searchbar, suggestionsView is added to parentView but not visible.
Hi,
This project is perfect for me but I have a little problem..
How to close suggestion list when i selected one ?
When I click on suggestion, I have my data, I do my treatment but the suggestion bar is always displayed.
Thx :)
Can you provide the same code in swift 2.3 . I need to implement in swift 2.3
When user performs first research, suggestionsView doesn't open.
ModernSearchBar doesn't show properly when created via UIViewController
Hey, your library is really interesting.
The only problem I found was the README.md
, which has an incomplete Installation Section
I created this iOS Open source Readme Template so you can take a look on how to easily create a complete Installation Section
If you want, I can help you to organize the lib.
What are your thoughts? ๐
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.