TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2015 |
SPMSupports SPM | ✗ |
Maintained by SelfStudio.
Convenience tool for the Pop animation framework written in Swift
To run the example project, clone the repo, and run pod install
from the Example directory first.
import Animate
var view:UIView! = UIView(frame: CGRectMake(10, 10, 50, 50))
view.backgroundColor = UIColor.orangeColor()
self.view.addSubview(view)
view.basic { (make) -> Void in
make.backgroundColor = UIColor.grayColor()
make.center = CGPointMake(200, 200)
}.delay(1)
.spring({ (make) -> Void in
make.backgroundColor = UIColor.orangeColor()
make.center = CGPointMake(200, 300)
}).delay(1)
.decay({ (make) -> Void in
make.velocity(NSValue(CGPoint:CGPointMake(150, 150)),forProperty:kPOPViewCenter)
make.velocity(NSValue(CGRect:CGRectMake(0, 0, 200, 200)),forProperty:kPOPViewBounds)
}).delay(1)
.done { () -> Void in
view.removeFromSuperview()
view = nil
}
//or
view.spring.frame = CGRectMake(0, 0, 200, 200)
iOS 8.0 or later
Animate is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Animate"
Animate is available under the MIT license. See the LICENSE file for more info.