Skip to content

UISearchBar+Translucent is an extension that allows you to use the translucent feature inside the standard UISearchBar UIKit component.

Notifications You must be signed in to change notification settings

valvoline/UISearchBar-Translucent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UISearchBar+Translucent

UISearchBar+Translucent is a very tiny and nifty extension that allows you to use the translucent features within the standard UISearchBar component.

The proposed solution is really simple. It involves the use of two extensions (one for UIImage and one for UISearchBar). The first one is used to create fake UIImage of 1x1 px starting from a UIColor. We take advantage of this technique to inject a fake transparent background inside the UISearchBar backgroundImage and scopeBarBackgroundImage property. The second extension allows you to use a convenience init method to take full advantage of this system within your working code.

As you can see, the tableview rows will scroll behind the UINavigationBar and UISearchBar and both of the components react in the same way by offering a graceful translucent effect.

Requirements

  • iOS 7+

Why?

Some of our students were in search of a UISearchBar with this capabilities during a challenge here on iOS developer Academy.

Manual Installation

Just drag the Extension file on your project.

How to use

No special use. The UISearchBar just inherits the required capabilities. That's it.

The BSD-3 License

Copyright (c) Costantino Pistagna 2017

About

UISearchBar+Translucent is an extension that allows you to use the translucent feature inside the standard UISearchBar UIKit component.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages