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

Overview

Platform Carthage compatible Awesome Language GitHub license

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

πŸ‘€ Demo

There are 5 types of animation for component.

border

borderWithShadow

background

ripple

text

:octocat: 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 3.0 πŸŽ‰

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

  • Compatible with Carthage

  • SYButton

  • SYLabel

  • SYTextField

  • SYView

  • SYTableViewCell

  • SYCollectionViewCell

Coming Soon

  • SYTextView
  • SYImageView

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 startAnimating(), stopAnimating()

SYButton

   let button = SYButton(frame: CGRect(x: 40, y: 50, width: 300, height: 50 ))
   button.setTitle("Border Animation", forState: .normal)
   button.animationType = .border
   view.addSubview(button)

  //Run Animation
  syButton.startAnimating()
  //End Animation
  syButton.stopAnimating()

Text Animation

Available Text Animation because of handleable text.

If you change text font size, name, you are supposed to call the `setFont()

    button
        .setFont(name: "ArialHebew", ofSize: 21)
        .startAnimating()

SYLabel

   let label = SYLabel(frame: CGRect(x: 40, y: 50, width: 300, height: 50 ))
   label.text = "Text Animation"
   label.labelTextColor =  .darkGray
   label.animationType = .text
   view.addSubview(label)

Text Animation

SYLabel Available Text Animation because of handleable text.

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

    label
        .setFont(name: "ArialHebew", ofSize: 21)
        .startAnimating()

SYTableViewCell

Inherit SYTableViewCell. customize your TableViewCell in UITableViewDataSource.

class YourCell: SYTableViewCell {
    ...
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("YourCell", forIndexPath: indexPath) as! YourCell
        cell.animationType = .background
        cell.startAnimating()
        return cell
    }

SYCollectionViewCell

Inherit SYCollectionViewCell. customize your CollectionViewCell in UICollectionViewDataSource.

class YourCell: SYCollectionViewCell {
    ...
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("YourCell", forIndexPath: indexPath) as! YourCell
        cell.animationType = .background
        cell.startAnimating()
        return cell
    }

SYTextField

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

Animation Type

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

   // default is border
   var animationType: AnimationType

   // Support 5 types of animation
   enum AnimationType: Int {
        case border
        case borderWithShadow
        case background
        case ripple
        case text
    }

inspectable

Set animationAdapter (with Integer) in place of animationType in IB.

  • border: 0
  • borderWithShadow: 1
  • background: 2
  • ripple: 3
  • text: 4

Animation Color

You can customize the properties of the color. These properties are inspectable.

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

Animation Duration, Timing

You can customize animationTimingFunction, animationDuration.

   //default is linear
   var animationTimingFunction: SYMediaTimingFunction

   enum SYMediaTimingFunction: Int {
        case linear
        case easeIn
        case easeOut
        case easeInEaseOut
   }
   //default is 1.5
   public var animationDuration: CGFloat

inspectable

Set animationTimingAdapter (with Integer) in place of animationTimingFunction in IB.

  • linear: 0
  • easeIn: 1
  • easeOut: 2
  • easeInEaseOut: 3

Customize Animatable Text

You can customize Animatable Text alignment. Support 9 types of alignment. Available SYButton, SYLabel now.

    var textAlignmentMode: TextAlignmentMode

    enum TextAlignmentMode {
        case topLeft, topCenter, topRight
        case left, center, right
        case bottomLeft, bottomCenter, bottomRight
    }

Whether animating or not

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

   public var isAnimating: Bool

πŸ’» Installation

CocoaPods

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

pod "SYBlinkAnimationKit"

Carthage

Add the following line to your Cartfile:

github "shoheiyokoyama/SYBlinkAnimationKit"

πŸ“ Requirements

  • iOS 8.3+
  • Xcode 9.0+
  • Swift 3.2+

β˜• Author

Shohei Yokoyama, [email protected]

πŸ”“ License

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

You might also like...
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

RetroBubbleText - A simple effect used in Retrogram which renders text with a fun bubble-style outline in SwiftUI
RetroBubbleText - A simple effect used in Retrogram which renders text with a fun bubble-style outline in SwiftUI

Retro Bubble Text This is a simple effect used in Retrogram which renders text w

Shimmer: A super-light modifier that adds a shimmering effect to any SwiftUI View
Shimmer: A super-light modifier that adds a shimmering effect to any SwiftUI View

SwiftUI-Shimmer ✨ Shimmer is a super-light modifier that adds a shimmering effec

Pulse animation for iOS written with Swift.
Pulse animation for iOS written with Swift.

Pulsator Pulse animation for iOS written with Swift. Great For: Pulses of Bluetooth, BLE, beacons (iBeacon), etc. Map Annotations Installation CocoaPo

TTouchAnimatedButton is a simple and flexible animation component fully written in Swift
TTouchAnimatedButton is a simple and flexible animation component fully written in Swift

TTouchAnimatedButton is a simple and flexible animation component fully written in Swift. TTouchAnimatedButton is developed to make user feel button click becomes more vivid and realistic.

A DSL to make animation easy on iOS with Swift.
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Swift animation library for iOS, tvOS and macOS.
Swift animation library for iOS, tvOS and macOS.

anim is an animation library written in Swift with a simple, declarative API in mind. // moves box to 100,100 with default settings anim { self.bo

Animation library for iOS in Swift
Animation library for iOS in Swift

TweenKit TweenKit is a powerful animation library that allows you to animate (or 'tween') anything. TweenKit's animations are also scrubbable, perfect

Easy animation library on iOS with Swift2
Easy animation library on iOS with Swift2

Cheetah Cheetah is an animation utility on iOS with Swift. Cheetah can animate any properties since Cheetah uses simple CADisplayLink run loop to chan

Comments
  • Fix build error

    Fix build error

    I could not build project for this error.

    21584427_2390731631152209_913103307_o

    Build Phases > Embed Frameworks I solved the problem by removing SYBlinkAnimationKit.framework in Build Phases > Embed Frameworks.

    68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3132393930302f66383134393466352d386565622d623766342d626239612d3030666466316663656434372e706e67

    opened by sakatore 1
  • Button cannot be tapped

    Button cannot be tapped

    I have created a button in IB and setting some properties in code. I have set the class to be SYButton. The weird thing is that the button is not tapped in its whole surface, but only on some points near its bottom. Do I need to set some specific constraints?

    My code quickSendButton.setTitle("Quick File Transfer", for: .normal) quickSendButton.setTitleColor(.white, for: .normal) quickSendButton.backgroundColor = .clear quickSendButton.animationBorderColor = .white quickSendButton.addTarget(self, action: #selector(self.selectAsset), for: .touchUpInside) quickSendButton.animationType = .borderWithShadow quickSendButton.animationDuration = 1.0 quickSendButton.startAnimating()

    Thanks

    opened by zois 0
  • SYTableViewCell stopAnimating and startAnimating

    SYTableViewCell stopAnimating and startAnimating

    When calling cell.stopAnimating() and cell.startAnimating() rather than doing them for individual cells it calls for all cells in the table view. Can we have this affect each cell individually?

    opened by chuninator 0
  • SYLabel Color not changing

    SYLabel Color not changing

    I am trying to change the color of label text but it still shows the default color.

    Here is my code to update text colour :

                loadingLabel.text = "Loading"
                loadingLabel.labelTextColor =  .white
                loadingLabel.animationType = .text
                loadingLabel.startAnimating()
    

    I tried to change colour in XIB also, but still not working.

    opened by unoiatech 0
Owner
Shohei Yokoyama
iOS Engineer at @smartnews ex-@CyberAgent
Shohei Yokoyama
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly

Simple Interface Core Animation Sica can execute various animations sequentially or parallelly. Features Animation with duration and delay parallel /

CATS Open Source Softwares 1k Nov 10, 2022
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan GlavaΕ‘ 9 Nov 5, 2022
Gemini is rich scroll based animation framework for iOS, written in Swift.

Overview What is the Gemini? Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which

Shohei Yokoyama 3k Dec 27, 2022
An easy way to add a simple, shimmering effect to any view in an iOS app.

Shimmer Shimmer is an easy way to add a shimmering effect to any view in your app. It's useful as an unobtrusive loading indicator. Shimmer was origin

Meta Archive 9.4k Dec 26, 2022
MotionBlur allows you to add motion blur effect to iOS animations.

MotionBlur MotionBlur allows you to add motion blur effect to your animations (currently only position's change). See the accompanying blog post to le

Arek Holko 1.5k Nov 3, 2022
Genie - A Playground to recreate the macOS Genie Effect.

Genie A Playground to recreate the macOS Genie Effect. For more information, please read the accompanying blog post: Recreating the macOS Genie Effect

Harshil Shah 66 Nov 18, 2022
RippleEffectView - A Neat Rippling View Effect

RippleEffectView Not only Uber-like animated screen background. RippleEffectView inspired by RayWenderlich.com article How To Create an Uber Splash Sc

Alex Sergeev 318 Dec 13, 2022