Skip to content

Easy to use UIToolbar for UINavigationBar.

License

Notifications You must be signed in to change notification settings

UnicorneCloud/iToolbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iToolbar

CI Status Version License Platform

iToolbar.gif

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

N/A

Installation

iToolbar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'iToolbar'

And execute this command in your project folder:

pod install

Usage of iToolbar

See the sample project iToolbar in 'Exemple' directory.

How to use details

Subclass the UINavigationBar with iNavigationBar

iNavigationBarSetup.png

Import the header

#import <iToolbar.h>

Setup the iToolbar

// Initialization of the iToolbar
_toolbar = [[iToolbar alloc] init];

// set the parent NavigationBar
[_toolbar setParentNavbar:(iNavigationBar*)self.navigationController.navigationBar];

// Set the scrolview to adjust when iToolbar is shown
[_toolbar setScollView:self.tableView];

Add button or Custom View

Add button

UIBarButtonItem *button1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(click:)];

[...]

_toolbar.items = @[button1, ...];

Add custom view

UIView *contentView = [[UIView alloc] init];
[contentView setBackgroundColor:UIColor.brownColor];
[_toolbar setContentView:contentView];

Show and Hide iToolbar

[_toolbar show:true]; // true for animated

[_toolbar hide:false]; // false to hide without animation

Author

ericpinet, [email protected]

License

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