Skip to content

SYBlinkAnimationKit is a blink effect animation framework for iOS, written in Swift.

License

Notifications You must be signed in to change notification settings

mohsinalimat/SYBlinkAnimationKit

 
 

Repository files navigation

SYBlinkAnimationKit

Platform Language License

SYBlinkAnimationKit is a blink effect animation framework for iOS, written in Swift.

Demo

There are 5 types of animation for component.

Border

BorderWithShadow

Background

Ripple

Text

Features

  • Animation like blink effect for UIKit

  • The 5 types of animation : Border, BorderWithShadow, Background, Ripple, Text

  • Easily usable

  • Customizable in any properties for animation

  • Support Swift 2.0

  • Support @IBDesignable and @IBInspectable. you can change properties in Interface Builder(IB) inspector. then IB update your custom objects automatically.

  • SYButton : available 5 types of Animation

  • SYLabel : available 5 types of Animation

  • SYTextField : available Border, BorderWithShadow, Background, Ripple

  • SYView : available Border, BorderWithShadow, Background, Ripple

Coming Soon

  • SYTextView

Demo App

Open Example/SYBlinkAnimationKit.xcworkspace and run SYBlinkAnimationKit-Example to see a simple demonstration.

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

Usage

First, Import SYBlinkAnimationKit in class.

   import SYBlinkAnimationKit

SYBlinkAnimationKit is designed to be easy to use.

  1. Call the SYClass. for example, SYButton, SYLabel, SYTextField, etc.
  2. If you use custom animation, call animation method startAnimation(), stopAnimation()
   let syButton = SYButton(frame: CGRectMake(40, 50, 300, 50))
   syButton.setTitle("Border Animation", forState: .Normal)
   syButton.syButtonAnimation = .Border
   self.view.addSubview(syButton)

  //Run Animation
  syButton.startAnimation()
  //End Animation
  syButton.stopAnimation() 

If you change text font size, name, you are supposed to call the setFontOfSize(), setFontNameWithSize()

  syButton.setFontOfSize(22.0)
  syButton.setFontNameWithSize("ArialHebew", size: 22.0)

If you set text color, you are supposed to set the labelTextColor property. To change text font, use font method as with SYButton.

   let syLabel = SYLabel(frame: CGRectMake(40, 50, 300, 50))
   syLabel.text = "Text Animation"
   syLabel.labelTextColor =  UIColor.darkGrayColor()
   syLabel.setFontNameWithSize("ArialHebew", size: 22.0)
   syLabel.syLabelAnimation = .Text
   self.view.addSubview(syLabel)

SYTextField stop animation. when a touch. but you can control this behavior.

   //The animation stop. when a touch. default is true
   syTextField.stopAnimationWithTouch = true

Customize animation properties

If you just want to change the types of animation, you can customize syClassAnimation.

Set syClassAnimationAdapter (with Integer) in place of syClassAnimation in IB. SYClassAnimation : Border = 0, BorderWithShadow = 1, Background = 2, Ripple = 3, Text = 4. default is Border.

   //SYLabel
   public var syLabelAnimation: SYLabelAnimation
   //Set syLabelAnimationAdapter in IB

If you just want to change the color of animation, you can customize the properties of the color.

These properties are inspectable.

   public var animationBorderColor: UIColor
   public var animationBackgroundColor: UIColor
   public var animationTextColor: UIColor
   public var animationRippleColor: UIColor

If you just want to change animation duration, timing, you can customize animationTimingFunction, animationDuration.

Set animationTimingAdapter (with Integer) in place of animationTimingFunction in IB. SYMediaTimingFunction : Linear = 0, EaseIn = 1, EaseOut = 2, EaseInEaseOut = 3. default is Linear.

   public var animationTimingFunction: SYMediaTimingFunction
   public var animationDuration: CGFloat //default is 2.0

If SYClass is in middle of animation, this property is true

   public var isAnimating: Bool

Installation

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

pod "SYBlinkAnimationKit"

Requirements

  • iOS 8.3+
  • Xcode 7.2

Author

Shohei Yokoyama, shohei.yok0602@gmail.com

License

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

About

SYBlinkAnimationKit is a blink effect animation framework for iOS, written in Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 43.4%
  • Swift 42.5%
  • Shell 13.3%
  • Ruby 0.8%