Swift animation made easy

Related tags

Animation Fluent
Overview

Logo

Fluent License MIT

Badge w/ Version Badge w/ Platform

Swift Animations made Easy

Installation

  • Add the following to your Podfile and run pod install
    pod 'Fluent', '~> 0.1'
  • or add the following to your Cartfile and run carthage update
    github "matthewcheok/Fluent"
  • or clone as a git submodule,

  • or just copy files in the Fluent folder into your project.

Using Fluent

Fluent makes writing animations declarative and chainable.

boxView
.animate(0.5)
.rotate(0.5)
.scale(2)
.backgroundColor(.blueColor())
.waitThenAnimate(0.5)
.scale(1)
.backgroundColor(.redColor())

Simply call one of the animation methods, of which only duration is required:

  • animate(duration: NSTimeInterval, velocity: CGFloat , damping: CGFloat, options: UIViewAnimationOptions)
  • waitThenAnimate(duration: NSTimeInterval, velocity: CGFloat , damping: CGFloat, options: UIViewAnimationOptions)

All common properties on UIView are supported:

  • scale(factor: CGFloat)
  • translate(x: CGFloat, y: CGFloat)
  • rotate(cycles: CGFloat)
  • backgroundColor(color: UIColor)
  • alpha(alpha: CGFloat)
  • frame(frame: CGRect)
  • bounds(bounds: CGRect)
  • center(center: CGPoint)

There are also relative versions of the transforms:

  • scaleBy(factor: CGFloat)
  • translateBy(x: CGFloat, y: CGFloat)
  • rotateBy(cycles: CGFloat)

You may not mix absolute and relative transformations in the same animation.

Using transforms

The order of the transformations are important!

To reverse the following:

boxView
.animate(1)
.translateBy(50, 50)
.rotateBy(0.5)
.scaleBy(2)
.backgroundColor(.blueColor())
.alpha(0.7)

We need to undo the transformations in reverse or get weird results:

boxView
.animate(1)
.scaleBy(0.5)
.rotateBy(-0.5)
.translateBy(-50, -50)
.backgroundColor(.redColor())

License

Fluent is under the MIT license.

You might also like...
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

Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.
Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.

Letters Animation Cool Letters Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

CCMRadarView uses the IBDesignable tools to make an easy customizable radar view with animation
CCMRadarView uses the IBDesignable tools to make an easy customizable radar view with animation

CCMRadarView CCMRadarView is a simple to use view that uses the new IBDesignable and IBInspectable features of XCode6 to easily configure the icon in

MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.
MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.

MGFlipView About If you are looking for an easy way of implement 3D flipping view, you are in the right place. MGFlipView allows to create flipping vi

BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.
BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.

BWMCoverView BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous l

Wave is a spring-based animation engine for iOS that makes it easy to create fluid, interruptible animations that feel great.
Wave is a spring-based animation engine for iOS that makes it easy to create fluid, interruptible animations that feel great.

Wave is a spring-based animation engine for iOS and iPadOS. It makes it easy to create fluid, interactive, and interruptible animations that feel great.

Elegant SVG animation kit for swift
Elegant SVG animation kit for swift

Elephant This is SVG animation presentation kit for iOS. Example You can run example app. Please open Example-iOS/Elephant-iOS.xcworkspace! Usage You

Releases(0.1.1)
Owner
Matthew Cheok
Matthew Cheok
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
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
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

Draven 1.9k Dec 9, 2022
Swift easy app launcher animation.

SwiftLauncher Swift easy app launcher animation. Usage. // Twitter. let logoLayer = CALayer() logoLayer.bounds = CGRect(x: 0, y: 0, width:

iOS.Jett 1 May 25, 2022
Circular reveal animations made easy

This library was created to allow developers to implement the material design's reveal effect. You can simply use this component to reveal and unverea

T-Pro 25 Dec 7, 2022