A concept to more easily define simple keyframe / multi-step animations in SwiftUI

Overview

๐ŸŽž Animate

MIT License

A concept to more easily define simple keyframe / multi-step animations in SwiftUI, without:

  • Defining an @State value for each property to be animated
  • Using asyncAfter

The approach has gone through a few very different iterations (see commit history), but there's still room for improvement. PRs and discussion are welcome!

Example Usage

struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                // This animation will start as soon as the view appears.
                .animate(
                    .start {
                        $0.opacity = 0.5
                    },
                    .at(2) {
                        $0.opacity = 1
                        $0.offsetY = 50
                        $0.scale = 1.5
                    }
                )
        }
    }
}

Minimum Requirements

  • iOS 15 / macOS 12 / tvOS 15 / watchOS 8
  • Swift 5.7 (Xcode 14)

License

This library is released under the MIT license. See the LICENSE file for more information.

To-Do

  • Improve documentation
  • Support for animation of arbitrary properties (via closure?)

Notes

You might also like...
DaisyChain is a micro framework which makes UIView animations chaining dead simple.

DaisyChain DaisyChain is a micro framework which makes UIView animations chaining dead simple. It uses the exact same interface you are familiars with

Simple UIButton subclass with additional state change animations (e.g. backgroundColor) and missing features
Simple UIButton subclass with additional state change animations (e.g. backgroundColor) and missing features

SimpleButton UIButton subclass with animated, state-aware attributes. Easy to subclass and configure! Full API docs Usage Just create your own SimpleB

Animations created with SwiftUI.
Animations created with SwiftUI.

A repository containing a variety of animations and Animated components created in SwiftUI that you can use in your own projects.

Match animations in SwiftUI and UIKit/AppKit
Match animations in SwiftUI and UIKit/AppKit

MatchedAnimation Match animations in SwiftUI and UIKit/AppKit. /// Draw a box in

Tools for SwiftUI that helps perform Path and Shape animations, such us morphing circle or shape transformations
Tools for SwiftUI that helps perform Path and Shape animations, such us morphing circle or shape transformations

SwiftUI+PathAnimations ๐Ÿ”ต Introduction This packages contains SimilarShape and InterpolatedShape, both can be used to achieve shapes animations with S

LottieView - Wrapper around Lottie in SwiftUI that allows chaining animations & triggering callbacks at certain frames

LottieView is a Wrapper around Lottie in SwiftUI that allows chaining animations & triggering callbacks at certain frames

Swiftui Spring Animations
Swiftui Spring Animations

Swiftui Spring Animations This repository serves as your reference for SwiftUI Spring Animations. It demonstrates use cases for the various types of s

Compose SpriteKit animations quickly in a declarative SwiftUI-style

ActionBuilder Caveat developer: As this package is pre-release, the API may change significantly without notice. It has not been tested, so use it at

Gravity is a simple Swift Package Manager to add gravity to UI objects easily.
Gravity is a simple Swift Package Manager to add gravity to UI objects easily.

Gravity -- Gravity is a simple Swift Package to add gravity to UI objects easily. -- How to use: Add a new Swift Package from XCode and paste the url

Releases(0.1.0)
Owner
Seb Jachec
Mobile engineer @ Daybridge ๐Ÿ“ฑ โ€ข gamer ๐ŸŽฎ โ€ข Apple enthusiast ๏ฃฟ โ€ข he/him
Seb Jachec
A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!

ver 2.0 NB! Breaking changes in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You need to enable i

Marin Todorov 2.9k Nov 11, 2022
โ›“ Easy to Read and Write Multi-chain Animations Lib in Objective-C and Swift.

ไธญๆ–‡ไป‹็ป This project is inspired by JHChainableAnimations! Why Choose LSAnimator & CoreAnimator? You can write complex and easy-to-maintain animations in

ๆœจๅญ 1.6k Nov 22, 2022
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 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
Easily pause and resume SwiftUI animations

swiftui-pausable-animation Easily pause and resume SwiftUI animations! Installation This component is distributed as a Swift package. Just add this re

Gordan Glavaลก 5 Nov 13, 2022
Easily build advanced custom animations on iOS.

INTUAnimationEngine makes it easy to build advanced custom animations on iOS. INTUAnimationEngine provides a friendly interface to drive custom animat

Intuit 1.1k Oct 19, 2022
Advanced Natural Motion Animations, Simple Blocks Based Syntax

FlightAnimator Moved to Swift 3.1 Support: For Swift 3.1 - Use tag Version 0.9.9 See Installation Instructions for clarification Introduction FlightAn

Anton 588 Sep 9, 2022
Designed for gesture-driven animations. Fast, simple, & extensible!

Yet Another Animation Library Designed for gesture-driven animations. Fast, simple, & extensible! It is written in pure swift 3.1 with protocol orient

Luke Zhao 510 Nov 15, 2022