Release 0.1.0
This commit is contained in:
1 parent
fd2c9b2650
commit
bb19fe0f7d
66 files changed
+3772
-14
No files matched your search
@@ -5,11 +5,68 @@
|
||||
[](http://cocoapods.org/pods/HamburgerButton)
|
||||
[](http://cocoapods.org/pods/HamburgerButton)
|
||||
|
||||
## Usage
|
||||
## Overview ##
|
||||
|
||||
To run the example project, clone the repo, and run `pod install` from the Example directory first.
|
||||
LBHamburgerButton is an iOS control that displays 3 lines (hamburger) and other icon (back, close...) without using image. It has a beautiful, clean and smooth transition between 2 state like Google Material Design or "close button" of Paper app.
|
||||
|
||||
## Requirements
|
||||
## Requirement ##
|
||||
|
||||
LBHamburgerButton use QuartzCore framework, so dont forget to add this framework. ARC (iOS 5+) is also required.
|
||||
|
||||
## How to use ##
|
||||
|
||||
First, you need to copy 2 files LBHamburgerButton.h/.m to your project. Then, import them to your class
|
||||
|
||||
```objc
|
||||
#import "LBHamburgerButton.h"
|
||||
```
|
||||
|
||||
This is a sub-class of UIButton. So you can init a simple button and call set-up method:
|
||||
|
||||
```objc
|
||||
buttonHamburger = [[LBHamburgerButton alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
|
||||
[buttonHamburger setUpHamburgerWithType:LBHamburgerButtonTypeCloseButton
|
||||
lineWidth:50
|
||||
lineHeight:50/6
|
||||
lineSpacing:5
|
||||
lineCenter:CGPointMake(50, 50)
|
||||
color:[UIColor whiteColor]];
|
||||
|
||||
|
||||
or use full contructor like this:
|
||||
|
||||
|
||||
```objc
|
||||
buttonHamburger = [[LBHamburgerButton alloc] initWithFrame:CGRectMake(0, 0, 100, 100)
|
||||
withHamburgerType:LBHamburgerButtonTypeCloseButton
|
||||
lineWidth:50
|
||||
lineHeight:50/6
|
||||
lineSpacing:5
|
||||
lineCenter:CGPointMake(50, 50)
|
||||
color:[UIColor whiteColor]];
|
||||
```
|
||||
|
||||
Set other propertises, add target add it to view like UIButton.
|
||||
|
||||
```objc
|
||||
[buttonHamburger setCenter:CGPointMake(120, 120)];
|
||||
[buttonHamburger setBackgroundColor:[UIColor blackColor]];
|
||||
[buttonHamburger addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[self.view addSubview:buttonHamburger];
|
||||
```
|
||||
|
||||
When you want to switch state, just call `switchState`.
|
||||
|
||||
```objc
|
||||
- (void)buttonPressed:(id)sender {
|
||||
LBHamburgerButton* btn = (LBHamburgerButton*)sender;
|
||||
[btn switchState];
|
||||
}
|
||||
```
|
||||
|
||||
## MIT License
|
||||
Copyright (c) 2014 Bang Nguyen
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -24,6 +81,8 @@ pod "HamburgerButton"
|
||||
|
||||
Giuseppe Nucifora, me@giuseppenucifora.com
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
HamburgerButton is available under the MIT license. See the LICENSE file for more info.
|
||||
Reference in new issue
Block a user