SYBlinkAnimationKit is a blink effect animation framework for iOS, written in Swift.
There are 5 types of animation for component.
Border
BorderWithShadow
Background
Ripple
Text
-
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
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.
First, Import SYBlinkAnimationKit in class.
import SYBlinkAnimationKit
SYBlinkAnimationKit is designed to be easy to use.
- Call the SYClass. for example,
SYButton
,SYLabel
,SYTextField
, etc. - 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
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
SYBlinkAnimationKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SYBlinkAnimationKit"
- iOS 8.3+
- Xcode 7.2
Shohei Yokoyama, shohei.yok0602@gmail.com
SYBlinkAnimationKit is available under the MIT license. See the LICENSE file for more info.