Skip to content

Latest commit

 

History

History
100 lines (62 loc) · 2.21 KB

README.md

File metadata and controls

100 lines (62 loc) · 2.21 KB

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, pineri01@gmail.com

License

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