Latest 1.3.0-beta
Homepage https://github.com/Lucashuang0802/LHToolbar
License MIT
Platforms ios 8.0
Authors

Build Status
Version
License
codecov
Platform

Description

LHToolbar is an alternative way to create a toolbar in iOS applications. Tool bars are widely used in iOS applications, however, UIToolbar class lacks of updates and flexibility, uncustomizable to some extent. It motivated me to create a container like toolbar so developers have more control and flexibility on layout and UIs. LHToolbar concentrates in providing fully functioning toolbar container, manipulation of container items and many more in the future.

Features

  • AutoLayout based toolbar container

Upcoming Feature

  • Vertical AutoLayout based toolbar container
  • Support of scrollable content
  • Support different size of content view item

An example to use

// initialize tool bar
LHToolbar *toolbar = [[LHToolbar alloc] initWithNumberOfItems:9];
toolbar.backgroundColor = [UIColor lightGrayColor];
CGRect mainScreenBounds = [UIScreen mainScreen].bounds;
CGFloat offset = 50.0f;
toolbar.frame = CGRectMake(offset / 2, CGRectGetHeight(mainScreenBounds) - toolbarHeight - colorToolbarHeight, CGRectGetWidth(mainScreenBounds) - offset, colorToolbarHeight);
[self.view addSubview:toolbar];

// add color picker buttons
NSDictionary *colorDict = @{
    @1: [UIColor colorWithRed:68.0/255.0f green:140.0/255.0f blue:230.0/255.0f alpha:1.0],
    @2: [UIColor colorWithRed:179.0/255.0f green:0/255.0f blue:223.0/255.0f alpha:1.0],
    @3: [UIColor redColor],
    @4: [UIColor colorWithRed:245.0/255.0f green:152.0/255.0f blue:0/255.0f alpha:1.0],
    @5: [UIColor colorWithRed:247.0/255.0f green:234.0/255.0f blue:0/255.0f alpha:1.0],
    @6: [UIColor colorWithRed:101.0/255.0f green:210.0/255.0f blue:0.0/255.0f alpha:1.0],
    @7: [UIColor blackColor],
    @8: [UIColor grayColor],
    @9: [UIColor whiteColor]
};
for (NSInteger i = 1; i < 10; i++) {
    UIButton *button = [[UIButton alloc] init];
    ];
    ;
    ;
    ;
    [toolbar setContentView:button atIndex:i -  1];
}

// reload tool bar
[toolbar reloadToolbar];

Requirements

  • iOS 8.0+
  • ARC

Installation

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

pod "LHToolbar"

Author

Lucas Huang, [email protected]

Contributing

Please follow these sweet contribution guidelines.

License

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

Latest podspec

{
    "name": "LHToolbar",
    "version": "1.3.0-beta",
    "summary": "An alternative way to create a tool bar for iOS applications.",
    "description": "LHToolbar is an alternative way to create a toolbar in iOS applications. Tool bars are widely used in iOS applications, however, UIToolbar class lacks of updates and flexibility, uncustomizable to some extent. It motivated me to create a container like toolbar so developers have more control and flexibility on layout and UIs. LHToolbar concentrates in providing fully functioning toolbar container, manipulation of container items and many more in the future.",
    "homepage": "https://github.com/Lucashuang0802/LHToolbar",
    "license": "MIT",
    "authors": {
        "Lucas Huang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Lucashuang0802/LHToolbar.git",
        "tag": "1.3.0-beta"
    },
    "social_media_url": "http://www.focushuang.com/",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "LHToolbar/**/*",
    "public_header_files": "LHToolbar/LHToolbar.h"
}

Pin It on Pinterest

Share This