Skip to content

LexDeBash/SpringAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringAnimation

Requirements

Requires Xcode 13 and Swift 5.6

SpringApp

To see all possible animations and curves in action download the SpringApp application: https://github.com/LexDeBash/SpringApp.git

Installation

Swift Package Manager

Copy framework url to clipboard:

image

Open your project in Xcode and go to the "Frameworks, Libraries and Embedded Content" section in the general project settings, then click on the add new library button:

image

Then select "Add Other..." -> "Add Package Dependency...":

image

In the window that opens, go to the search bar and paste the url https://github.com/LexDeBash/SpringAnimation.git Then press the button "Add Package":

image

In the package selection window, check the SptingAnimation and press "Add Package":

image

Usage with Storyboard

In Identity Inspector, connect the UIView to SpringView Class and set the animation properties in Attribute Inspector.

image

Usage with Code

springView.animation = "squeezeDown"
springView.animate()

Chaining Animations

springView.y = -50
animateToNext {
  springView.animation = "fall"
  springView.animateTo()
}

Functions

animate()
animateNext { ... }
animateTo()
animateToNext { ... }

Animations

pop
slideLeft
slideRight
slideDown
slideUp
squeezeLeft
squeezeRight
squeezeDown
squeezeUp
fadeIn
fadeOut
fadeOutIn
fadeInLeft
fadeInRight
fadeInDown
fadeInUp
zoomIn
zoomOut
fall
shake
flipX
flipY
morph
squeeze
flash
wobble
swing

Curves

easeIn
easeOut
easeInOut
linear
spring
easeInSine
easeOutSine
easeInOutSine
easeInQuad
easeOutQuad
easeInOutQuad
easeInCubic
easeOutCubic
easeInOutCubic
easeInQuart
easeOutQuart
easeInOutQuart
easeInQuint
easeOutQuint
easeInOutQuint
easeInExpo
easeOutExpo
easeInOutExpo
easeInCirc
easeOutCirc
easeInOutCirc
easeInBack
easeOutBack
easeInOutBack

Properties

autostart
autohide

title
curve

force
delay
duration
damping
velocity
repeatCount
x
y
scaleX
scaleY
scale
rotate

Autostart

Allows you to animate without code. Don't need to use this if you plan to start the animation in code.

Autohide

Saves you the hassle of adding a line springView.alpha = 0 in viewDidLoad().

Known issue

License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages