Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

jasudev/AnimateText

Repository files navigation

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

PlatformsiOSmacOSinstagramSPMMIT

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.@Statevartext:String="AnimateText"/// The type used to split text.@Statevartype:ATUnitType=.letters/// Custom user info for the effect.@StatevaruserInfo:Any?=nilAnimateText<CustomEffect>($text, type: type, userInfo: userInfo)
  2. Each effect only needs to conform to the ATTextAnimateEffect protocol.

    /// Custom animation effect.publicstructCustomEffect:ATTextAnimateEffect{publicvardata:ATElementDatapublicvaruserInfo:Any?publicinit(_ data:ATElementData, _ userInfo:Any?){self.data= dataself.userInfo= userInfo}publicfunc body(content:Content)->someView{        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.publicprotocolATTextAnimateEffect:ViewModifier{    /// Informational data required for each element animation.vardata: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.varuserInfo:Any?{get}init(_ data:ATElementData, _ userInfo:Any?)}

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding AnimateText as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies:[.package(url:"https://github.com/jasudev/AnimateText.git",.branch("main"))]

Contact

instagram :@dev.fabula
email :dev.fabula@gmail.com

License

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


[8]ページ先頭

©2009-2025 Movatter.jp