SimpleAnimation is a UIView extension that makes adding basic animations, like fades and bounces, simple...
view.bounceIn(from: .left)
...with sensible defaults...
view.popIn()
...while remaining customizable
view.shake(toward: .top, amount: 0.5, duration: 2, delay: 0.5)
You can add SimpleAnimation to an Xcode project by adding it as a package dependency.
If you want to use SimpleAnimation in a SwiftPM project, it's as simple as adding it to a dependencies
clause in your Package.swift
:
dependencies: [
.package(url: "https://github.com/acosmicflamingo/SimpleAnimation.git", from: "0.4.2")
]
To integrate SimpleAnimation into a project using CocoaPods, add the following to your Podfile
:
pod "SimpleAnimation"
To integrate SimpleAnimation into a project using Carthage, add the following to your Cartfile
:
github "keithito/SimpleAnimation"
If you are using Xcode 8 to build your project, you need to use version 0.3.2 of SimpleAnimation. You can do so by specifying the version number in your Podfile or Cartfile.
The following animations are supported so far:
- fadeIn
- fadeOut
- fadeColor
- slideIn
- slideOut
- bounceIn
- bounceOut
- popIn
- popOut
- hop
- shake
Please see the example ViewController for more usage examples. To build the example in XCode, open Example/Example.xcodeproj.
SimpleAnimation is available under the MIT license. See the LICENSE file for more info.