paoloboschini / Icomations

Swifty hamburger animations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Icomations

Swifty hamburger animations

alt tag

Basic Usage

See example project for a demo.

Import Icomation.swift in your project. Add a button to your view via Interface Builder, change the class to Icomation in the Identity Inspector and connect an outlet to it. Or create a new Icomation in code

var icomation = Icomation(frame: CGRectMake(0, 0, 50, 50))
view.addSubview(icomation)

Set a type

icomation.type = IconType.ArrowUp

Choose a color for each segment (default is white)

icomation.topShape.strokeColor = UIColor.redColor().CGColor
icomation.middleShape.strokeColor = UIColor.blueColor().CGColor
icomation.bottomShape.strokeColor = UIColor.blackColor().CGColor

Set a duration for the animation

icomation.animationDuration = 1.0

Set the number of rotations for the animation

icomation.numberOfRotations = 3

About

Swifty hamburger animations

License:MIT License


Languages

Language:Swift 100.0%