This library for animating text. Developed with SwiftUI. This library supports iOS/macOS.

Overview

AnimateText

This library for animating text. Developed with SwiftUI. This library supports iOS/macOS.

Platforms iOS macOS instagram SPM MIT

Screenshot

AnimateText.mp4

Example

https://fabulaapp.page.link/224

Usages

  1. AnimateText

    /// A view that animates binding text. Passing the effect type as a generic.
    /// struct AnimateText<E> where E : ATTextAnimateEffect
    /// Binding the text to be expressed.
    @State var text: String = "AnimateText"
    
    /// The type used to split text.
    @State var type: ATUnitType = .letters
    
    /// Custom user info for the effect.
    @State var userInfo: Any? = nil
    
    AnimateText<CustomEffect>($text, type: type, userInfo: userInfo)
    
  2. Each effect only needs to conform to the ATTextAnimateEffect protocol.

    /// Custom animation effect.
    public struct CustomEffect: ATTextAnimateEffect {
    
        public var data: ATElementData
        public var userInfo: Any?
    
        public init(_ data: ATElementData, _ userInfo: Any?) {
            self.data = data
            self.userInfo = userInfo
        }
    
        public func body(content: Content) -> some View {
            content
                .opacity(data.value)
                .animation(.easeInOut.delay(Double(data.index) * 0.06), value: data.value)
        }
    }
  3. ATTextAnimateEffect protocol

    /// A protocol to implement text animation effects.
    public protocol ATTextAnimateEffect: ViewModifier {
    
        /// Informational data required for each element animation.
        var data: ATElementData { get }
        /// Custom user info for the effect.
        /// The effect maintains a strong reference to this object until it (the effect) is invalidated. This parameter may be nil.
        var userInfo: Any? { get }
    
        init(_ data: ATElementData, _ userInfo: Any?)
    }
    

Contact

instagram : @dev.fabula
email : [email protected]

License

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

You might also like...
Physics-based animations for iOS, tvOS, and macOS.

Advance An animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respo

This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS
This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS

Swift-Collections About: This repo contains a collection of projects built using swift and objective-c Contains projects for macOS iOS iPad watchOS tv

Flip is a book tracking app built for iOS and iPadOS. Coming soon to watchOS and macOS.
Flip is a book tracking app built for iOS and iPadOS. Coming soon to watchOS and macOS.

Flip Flip is a project aimed at helping users manage their library of books. It has a clean user interface, allows users to sort and filter their libr

SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image

SwiftUI.AnimatedImage SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image Screen.Recording.2021-07-31.at.02.18.33.mov Insta

Genie - A Playground to recreate the macOS Genie Effect.
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

Vitals - A tiny macOS process monitor lives in the menu bar, keeping track of resource usage
Vitals - A tiny macOS process monitor lives in the menu bar, keeping track of resource usage

Vitals lives in the menu bar, keeping track of resource usage in the background so you can summon it instantly at any time.

A macOS menu bar app for copy animated LIHKG stickers to clipboard.
A macOS menu bar app for copy animated LIHKG stickers to clipboard.

LIHKG GIFs A macOS menu bar app created for easily sending LIHKG stickers to Microsoft Teams. This app will try to load a GIF selected by user into th

Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Library for creating swipe actions for any SwiftUI View

SwipeActions Library for creating swipe actions for any SwiftUI View, similar to

Releases(0.5.0)
Owner
jasu
jasu
A SwiftUI implementation of Wave animating shape.

WaveAnimation A SwiftUI implementation of Wave animating shape. Preview Usage import SineWaveShape SineWaveShape(percent: 0.4, strength: 30, frequency

Zerlz 16 Sep 23, 2022
LottieUI - A library developed to make Lottie easy to implement. It supports iOS and macOS

LottieUI It is a library developed to make Lottie easy to implement. It supports

jasu 51 Dec 24, 2022
☄️Comets: Animating Particles in Swift

Comets ☄️ Comets: Animating Particles in Swift animation made by kevin as part of Voicy design implements Bennet van der Linden medium Comets: Animati

Cruz 593 Dec 28, 2022
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
A port of SwiftUILab's Advanced Animations that also supports macOS

SwiftUILab Advanced Animations on the Mac as well A port of SwiftUILab's Advanced Animations that also supports macOS Here's the Ghist of the original

Mihaela Mihaljevic Jakic 10 Jan 2, 2023
Fortune spinning wheel library built using SwiftUI, supports dynamic content.

Fortune Wheel Fortune spinning wheel ?? library built using SwiftUI, supports dynamic content. Preview - Spin Wheel ⚙️ CocoaPods Installation FortuneW

Sameer Nawaz 51 Dec 23, 2022
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

Bi Weiming 31 Mar 10, 2021
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

Simeon Saëns 5 Aug 29, 2022
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

Onur Ersel 555 Dec 12, 2022