Giter Site home page Giter Site logo

lijie121210 / tbicontransitionkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexeybelezeko/tbicontransitionkit

0.0 1.0 0.0 216 KB

TBIconTransitionKit is an easy to use icon transition kit that allows to smoothly change from one shape to another.

License: MIT License

Ruby 4.48% Objective-C 64.68% C 1.98% Shell 28.86%

tbicontransitionkit's Introduction

TBIconTransitionKit

Version License Platform

TBIconTransitionKit is an easy to use icon transition kit that allows to smoothly change from one shape to another. Build on UIButton with CAShapeLayers It includes a set of the most common navigation icons. Feel free to recolor the them as you like and customise shapes — adjust the line spacing, edit the line width and it's cap.

Animation on dribbble.com

Both ways animated transitions:

  • Menu ↔ Arrow
  • Menu ↔ Cross
  • Cross ↔ Plus
  • Plus ↔ Minus

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Just add TBAnimationButton to you UIView with IB or code. You can use it with autolayout.

#import <TBIconTransitionKit/TBAnimationButton.h>

@interface TBViewController ()

@property (weak, nonatomic) IBOutlet TBAnimationButton *button;

@end

@implementation TBViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.button.currentState = TBAnimationButtonStateMenu;
}

- (IBAction)onButton:(TBAnimationButton *)sender
{
  if (sender.currentState == TBAnimationButtonStateMenu) {
    [sender animationTransformToState:TBAnimationButtonStateArrow];
  } else if (sender.currentState == TBAnimationButtonStateArrow) {
    [sender animationTransformToState:TBAnimationButtonStateMenu];
  }
}

Customize the design

  • lineHeight
  • lineWidth
  • lineSpacing
  • lineColor
  • lineCap

After the change of one of this properties you have to call updateAppearance to update the view.

Requirements

  • iOS 7 or higher
  • Automatic Reference Counting (ARC)

Installation

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

pod "TBIconTransitionKit"

Author

License

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

tbicontransitionkit's People

Watchers

viwii avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.