Giter VIP home page Giter VIP logo

shsearchbar's Introduction

SHSearchBar

[![CI Status](http://img.shields.io/travis/Stefan Herold/SHSearchBar.svg?style=flat)](https://travis-ci.org/Stefan Herold/SHSearchBar) Version License Platform

The clean and shiny search bar that does what UISearchBar does only with dirty hacks. This search bar class is designed to overcome the customization limits of UISearchBar. The difference here is that this class does not inherit UISearchBar but composes a new UIView object by using a UITextField that is much easier to use. The limits of the search bar are as follows:

  • no clean way to left align the placeholder
  • the cancel button is hard to taylor to your needs
  • generally the appearance is not customizable (e.g. the font of the text)
  • there are some strange behaviours when you set a custom background image

Since I use a UITextField these restrictions do not apply.

Example

The example project shows different use cases of the searchbar. To run it, clone the repo, and run pod install from the Example directory first.

Installation

SHSearchBar is compatible with iOS 8 or higher and build with Xcode 8 beta 4 and the newest Swift 3 syntax. It is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SHSearchBar"

Next Steps

  • solve the scaling text on textField width animation bug when there are multiple SHSearchBars on the same view (liek the example)
  • put the examples with images in this readme
  • add support for a blurred background view
  • test programmatic use
  • implement storyboard support (low priority)

Author

Stefan Herold, [email protected]

License

SHSearchBar is available under the MIT license. See the LICENSE file for more info.

shsearchbar's People

Contributors

blackjacx avatar

Watchers

Carabineiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.