doh

DOHamburgerButton

Animated Hamburger Button written in Swift

Showing:

Popularity

Downloads/wk

0

GitHub Stars

70

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Categories

Readme

DOHamburgerButton

Carthage compatible CocoaPods Version Platform License

Animated Hamburger Button written in Swift

Demo

Requirements

  • iOS 7.0+
  • Swift 1.2

Installation

Carthage

Add the following line to your Cartfile:

github "okmr-d/DOHamburgerButton"

CocoaPods

Add the following line to your Podfile:

pod 'DOHamburgerButton'

Manual

Just drag DOHamburgerButton.swift to your project.

How to use

By coding

1.create a button

let button = DOHamburgerButton(frame: CGRectMake(0, 0, 44, 44))
button.color = UIColor.whiteColor() // you can set button color
self.view.addSubview(button)

2.Add tapped function

button.addTarget(self, action: Selector("tapped:"), forControlEvents: .TouchUpInside)
func tapped(sender: DOHamburgerButton) {
    if sender.selected {
        sender.deselect()
    } else {
        sender.select()
    }
}

By using Storyboard or XIB

1.Add Button object and set Custom Class DOHamburgerButton via Storyboard

(and you can set button color) change Color

2.Add tapped function

@IBAction func tapped(sender: DOHamburgerButton) {
    if sender.selected {
        sender.deselect()
    } else {
        sender.select()
    }
}

3.Connect Outlet
connect outlet

DEMO

There is a demo project added to this repository, so you can see how it works.

License

This software is released under the MIT License.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100