All Projects → PhilippeBoisney → Modernsearchbar

PhilippeBoisney / Modernsearchbar

Licence: other
The famous iOS search bar with auto completion feature implemented.

Programming Languages

swift
15916 projects
swift3
66 projects

Projects that are alternatives of or similar to Modernsearchbar

Ionic Selectable
An Ionic-based versatile and highly customizable component that serves as a replacement to Ionic Select, and allows to search items, create items, customize the layout with templates and much more.
Stars: ✭ 459 (+174.85%)
Mutual labels:  search, searchbar
Minisearch
Tiny and powerful JavaScript full-text search engine for browser and Node
Stars: ✭ 737 (+341.32%)
Mutual labels:  search, autocomplete
Zsh Autocomplete
🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
Stars: ✭ 641 (+283.83%)
Mutual labels:  autocomplete, autocompletion
Vue Simple Suggest
Feature-rich autocomplete component for Vue.js
Stars: ✭ 324 (+94.01%)
Mutual labels:  search, autocomplete
Search Ui
Search UI. Libraries for the fast development of modern, engaging search experiences.
Stars: ✭ 1,294 (+674.85%)
Mutual labels:  search, searchbar
Googleapi
C# .NET Core Google Api (Maps, Places, Roads, Search, Translate). Supports all endpoints and requests / responses.
Stars: ✭ 346 (+107.19%)
Mutual labels:  search, autocomplete
Cmake Ide
Use Emacs as a C/C++ IDE
Stars: ✭ 661 (+295.81%)
Mutual labels:  autocomplete, autocompletion
Autocomplete
Suggests and completes words as you type! Write faster and more efficiently.
Stars: ✭ 18 (-89.22%)
Mutual labels:  autocomplete, autocompletion
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+659.28%)
Mutual labels:  search, autocomplete
Ynsearch
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!
Stars: ✭ 1,131 (+577.25%)
Mutual labels:  search, searchbar
Autocomplete.js
Simple autocomplete pure vanilla Javascript library.
Stars: ✭ 3,428 (+1952.69%)
Mutual labels:  search, autocomplete
Ide Stubs
Phalcon IDE Stubs
Stars: ✭ 137 (-17.96%)
Mutual labels:  autocomplete, autocompletion
Rskcollectionviewretractablefirstitemlayout
A light-weight UICollectionViewFlowLayout subclass that allows the first item to be retractable.
Stars: ✭ 281 (+68.26%)
Mutual labels:  search, searchbar
Vue Instant
vue instant allows you to easily create custom search controls with auto suggestions for your vue 2 applications
Stars: ✭ 397 (+137.72%)
Mutual labels:  search, autocomplete
Autocomplete
Accessible autocomplete component for vanilla JavaScript and Vue.
Stars: ✭ 277 (+65.87%)
Mutual labels:  search, autocomplete
Elasticsuite
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
Stars: ✭ 647 (+287.43%)
Mutual labels:  search, autocomplete
fast-autocomplete
Fast Autocomplete: When Elastcsearch suggestions are not fast and flexible enough
Stars: ✭ 201 (+20.36%)
Mutual labels:  autocomplete, autocompletion
django-search-admin-autocomplete
Simple django app that add autocomplete to search inside admin panel.
Stars: ✭ 28 (-83.23%)
Mutual labels:  autocomplete, autocompletion
Autoprompt
Auto complete command prompts for C# .Net console apps
Stars: ✭ 22 (-86.83%)
Mutual labels:  autocomplete, autocompletion
Smartmaterialspinner
The powerful android spinner library for your application
Stars: ✭ 108 (-35.33%)
Mutual labels:  search, autocomplete

Platform Language License

PRESENTATION

This search bar will allow you to offer suggestions words to your users when they are looking for something using default iOS search bar. Enjoy it !

DEMO

Two ways to use this lib :

  • One with a simple array of string (Array<String>)
  • The other with an array of custom object (Array<ModernSearchBarModel>) if you want to get image of each row from an url.
SIMPLE ADVANCED

INSTALLATION

CocoaPods

You can use CocoaPods to install ModernSearchBar by adding it to your Podfile:

pod 'ModernSearchBar'

Manually

  1. Download and drop all *.swift files contained in Pod folder in your project.
  2. Don't forget to import the assets folder too.
  3. Enjoy !

USAGE

1 - Configure StoryBoard (Custom Class)

2 - Configure ViewController

//Import lib on the top of ViewController
import ModernSearchBar

//Create an IBOutlet from your searchBar
 @IBOutlet weak var modernSearchBar: ModernSearchBar!

//Extend your ViewController with 'ModernSearchBarDelegate'
class ViewController: UIViewController, ModernSearchBarDelegate

//Implement the delegation
self.modernSearchBar.delegateModernSearchBar = self

//Set datas to fill the suggestionsView of the searchbar.
//Two ways (you have to choose only one, you can't implement both obviously)

// 1 - With an Array<String>
var suggestionList = Array<String>()
suggestionList.append("Onions")
suggestionList.append("Celery")

self.modernSearchBar.setDatas(datas: suggestionList)

// 2 - With custom Array<ModernSearchBarModel>
var suggestionListWithUrl = Array<ModernSearchBarModel>()
suggestionListWithUrl.append(ModernSearchBarModel(title: "Alpha", url: "https://github.com/PhilippeBoisney/ModernSearchBar/raw/master/Examples%20Url/exampleA.png"))
suggestionListWithUrl.append(ModernSearchBarModel(title: "Bravo", url: "https://github.com/PhilippeBoisney/ModernSearchBar/raw/master/Examples%20Url/exampleB.png"))

self.modernSearchBar.setDatasWithUrl(datas: suggestionListWithUrl)

DELEGATE

ModernSearchBarDelegate inherit from UISearchBarDelegate, so you can find commons methods you already use in your project. Also, I add those methods to handle click actions on suggestionsView.

///Called if you use String suggestion list
func onClickItemSuggestionsView(item: String) {
   print("User touched this item: "+item)
}

///Called if you use Custom Item suggestion list
func onClickItemWithUrlSuggestionsView(item: ModernSearchBarModel) {
   print("User touched this item: "+item.title+" with this url: "+item.url.description)
}

///Called when user touched shadowView
func onClickShadowView(shadowView: UIView) {
   print("User touched shadowView")
}

CUSTOMIZING

//Modify shadows alpha
self.modernSearchBar.shadowView_alpha = 0.8

//Modify the default icon of suggestionsView's rows
self.modernSearchBar.searchImage = ModernSearchBarIcon.Icon.none.image

//Modify properties of the searchLabel
self.modernSearchBar.searchLabel_font = UIFont(name: "Avenir-Light", size: 30)
self.modernSearchBar.searchLabel_textColor = UIColor.red
self.modernSearchBar.searchLabel_backgroundColor = UIColor.black

//Modify properties of the searchIcon
self.modernSearchBar.suggestionsView_searchIcon_height = 40
self.modernSearchBar.suggestionsView_searchIcon_width = 40
self.modernSearchBar.suggestionsView_searchIcon_isRound = false

//Modify properties of suggestionsView
///Modify the max height of the suggestionsView
self.modernSearchBar.suggestionsView_maxHeight = 1000
///Modify properties of the suggestionsView
self.modernSearchBar.suggestionsView_backgroundColor = UIColor.brown
self.modernSearchBar.suggestionsView_contentViewColor = UIColor.yellow
self.modernSearchBar.suggestionsView_separatorStyle = .singleLine
self.modernSearchBar.suggestionsView_selectionStyle = UITableViewCellSelectionStyle.gray
self.modernSearchBar.suggestionsView_verticalSpaceWithSearchBar = 10
self.modernSearchBar.suggestionsView_spaceWithKeyboard = 20

Version

1.5

License

Copyright 2017 Boisney Philippe

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create New Pull Request

Author

Philippe BOISNEY (phil.boisney(@)gmail.com)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].