[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6980":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},6980,"RazzleDazzle","IFTTT\u002FRazzleDazzle","IFTTT","A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros.","http:\u002F\u002Fifttt.github.io",null,"Swift",3349,285,83,13,0,59.37,"MIT License",false,"main",true,[],"2026-06-12 04:00:31","[![Open Source at IFTTT](http:\u002F\u002Fifttt.github.io\u002Fimages\u002Fopen-source-ifttt.svg)](http:\u002F\u002Fifttt.github.io)\n\n![RazzleDazzle](.\u002FExample\u002FDocs\u002Frazzledazzlebanner.jpg)\n\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) [![CocoaPods Version](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FRazzleDazzle.svg)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FRazzleDazzle)\n\n`RazzleDazzle` is a simple AutoLayout-friendly keyframe animation framework for iOS, written in Swift. Perfect for scrolling app intros.\n\n![RazzleDazzle](.\u002FExample\u002FDocs\u002Frazzledazzle-demo.gif)\n\n`RazzleDazzle\t` grew from [`JazzHands`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FJazzHands), an Objective-C scrolling keyframe animations library by IFTTT.\n\n[`JazzHands`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FJazzHands) is used extensively in [IF and DO for iPhone and iPad](https:\u002F\u002Fifttt.com\u002Fproducts), most famously in the app intro.\n\n## What's `RazzleDazzle` for?\n### Scrolling App Intro Animations\n`RazzleDazzle` is the easiest way to add scrollview-powered animations to the app intro of your Swift app. If you're adding a scrolling intro to your Objective-C app, check out [`JazzHands`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FJazzHands)!\n\nFor some examples of how [`JazzHands`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FJazzHands) and `RazzleDazzle` can be used in practice, check out the intros of both [IF and DO for iPhone and iPad](https:\u002F\u002Fifttt.com\u002Fproducts), as well as the scrolling animations of the buttons in the DO apps by IFTTT.\n\n### Easy Paging Scrollview Layouts in an AutoLayout World\n`RazzleDazzle`'s `keep(view: onPage:)` function of the `AnimatedPagingScrollViewController` is a super easy way to lay out a paging scroll view that does what you expect it to when your app is rotated or used in the new split-screen iPad views of iOS9, a notoriously tricky aspect of getting your apps fully AutoLayout-ready. `RazzleDazzle` sets up an AutoLayout-friendly paging scroll view controller for you, and all you need to do to make your layout respond properly to any view size changes is tell `RazzleDazzle` which page you'd like things on.\n\nAs a bonus, because it's built on top of the animations library, you can even tell `RazzleDazzle` that you'd like one of your views to show up on multiple pages while other views scroll past, with a single call to `keep(view: onPages:)`.\n\n## Installation\n\n### Carthage\n\n`RazzleDazzle` is available through [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage). To install\nit, simply add the following line to your `Cartfile`:\n\n```\ngithub \"IFTTT\u002FRazzleDazzle\"\n```\n\n### CocoaPods\n\n`RazzleDazzle` is also available through [CocoaPods](http:\u002F\u002Fcocoapods.org). To install\nit, simply add the following line to your `Podfile`:\n\n```ruby\npod \"RazzleDazzle\"\n```\nBecause `RazzleDazzle` is written in Swift, be sure to add `use_frameworks!` at the top of your Podfile.\n\n```ruby\nsource 'https:\u002F\u002Fgithub.com\u002FCocoaPods\u002FSpecs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'RazzleDazzle'\n```\n\n## Demo App\n\nOpen `Example\u002FRazzleDazzle.xcworkspace` and run `RazzleDazzleDemo` to see a simple demonstration of moving, scaling, fading, and transforming views in a scrolling app intro.\n\n## Usage\n\n### Animated Paging Scroll Views\nFirst, import `RazzleDazzle` into your view controller, and subclass `AnimatedPagingScrollViewController`.\n\n```swift\nimport RazzleDazzle\n\nclass ViewController: AnimatedPagingScrollViewController {\n```\n\nTell the paging scroll view controller how many pages it should have.\n\n```swift\noverride func numberOfPages() -> Int {\n\treturn 4\n}\n```\n\nAdd any views you want to animate to the scrollview's `contentView` on `viewDidLoad`.\n\n```swift\noverride func viewDidLoad() {\n\tsuper.viewDidLoad()\n\tcontentView.addSubview(firstLabel)\n}\n```\n\nAdd your desired vertical position and size constraints to your views.\n\n```swift\ncontentView.addConstraint(NSLayoutConstraint(item: firstLabel, attribute: .CenterY, relatedBy: .Equal, toItem: contentView, attribute: .CenterY, multiplier: 1, constant: 0))\n```\n\nTell the animated paging scroll view controller to keep the view on the page you want it to stay on.\n\n```swift\nkeepView(firstLabel, onPage: 1)\n```\n\nYou can even tell the animated paging scroll view controller to keep the view still on more than one page, while other views scroll past it.\n\n```swift\nkeepView(firstLabel, onPages: [1,2])\n```\n\nOr offset the view's center from the page's center:\n\n```swift\nkeepView(firstLabel, onPage: 1.25)\n```\n\nJust make sure that if you're using any of the `keepView` functions that you don't set an x-position `NSLayoutConstraint` on the view, as it will conflict with the animated x-position constraints generated by `RazzleDazzle`.\n\n### RazzleDazzle Animations\nGenerally, creating animations in `RazzleDazzle` works similarly to creating animations in `JazzHands`. First, import `RazzleDazzle` into your view controller.\n\n```swift\nimport RazzleDazzle\n```\n\nThen, create an Animator to manage all of the animations in this `UIViewController`.\n\n```swift\nvar animator = Animator()\n```\n\nCreate an animation for a view that you want to animate. There are multiple types of animation that can be applied to a view. For this example, we'll use `AlphaAnimation`, which fades a view in and out.\n\n```swift\nlet alphaAnimation = AlphaAnimation(view: viewThatYouWantToAnimate)\n```\n\nRegister the animation with the animator.\n\n```swift\nanimator.addAnimation(alphaAnimation)\n```\n\nAdd some keyframes to the animation. Let's fade this view out between times 30 and 60.\n\n```swift\nalphaAnimation[30] = 1\nalphaAnimation[60] = 0\n```\n\nNow, to animate the view, tell the animator what time it is. For example, to tie this animation to a UIScrollView, notify the animator of time in the scroller's delegate method.\n\n```swift\nfunc scrollViewDidScroll(_ scrollView: UIScrollView) {\n\tanimator.animate(scrollView.contentOffset.x)\n}\n```\n\nThis will produce an effect where the view will be fully faded in and visible for scroll positions 0 to 30. Between scroll positions 30 and 60, the view will fade out to be invisible, and it will stay faded out for scroll positions greater than 60.\n\n## Animation Types\n\n`RazzleDazzle` supports several types of animations:\n\n* **AlphaAnimation** animates the `alpha` property _(creates fade effects)_.\n* **BackgroundColorAnimation** animates the `backgroundColor` property.\n* **RotationAnimation** animates a rotation transform _(for rotation effects)_.\n* **ScaleAnimation** applies a scaling transform _(to scale view sizes)_.\n* **TranslationAnimation** applies a translation transform _(to translate view position)_.\n* **CornerRadiusAnimation** animates the `layer.cornerRadius` property.\n* **HideAnimation** animates the `hidden` property _(hides and shows views)_.\n* **LayerStrokeStartAnimation** animates the `strokeStart` property of a `CAShapeLayer` _(does not work with LayerStrokeEndAnimation)_.\n* **LayerStrokeEndAnimation** animates the `strokeEnd` property of a `CAShapeLayer` _(does not work with LayerStrokeStartAnimation)_.\n* **LayerFillColorAnimation** animates the `fillColor` property of a `CAShapeLayer`.\n* **LayerStrokeColorAnimation** animates the `strokeColor` property of a `CAShapeLayer`.\n* **PathPositionAnimation** animates the `layer.position` property of a `UIView` along a path.\n* **LabelTextColorAnimation** animates the `textColor` property of a `UILabel`.\n* **ConstraintConstantAnimation** animates an `AutoLayout` constraint constant.\n* **ConstraintMultiplierAnimation** animates an `AutoLayout` constraint constant as a multiple of an attribute of another view _(to offset or resize views based on another view's size)_\n* **ScrollViewPageConstraintAnimation** animates an `AutoLayout` constraint constant to place a view on a scroll view page _(to position views on a scrollView using AutoLayout)_. This is the animation doing the heavy lifting for `AnimatedPagingScrollViewController`'s `keepView(view: onPage:)` function.\n\n## Creating Custom Animation Types\n\n`RazzleDazzle` is easy to extend by creating your own custom animation types!\n\n### Custom Animation Types\n\nTo create your own custom animation type, your type needs to conform to the `Animatable` protocol. All this requires is that you implement an `animate(time:)` function that takes a `CGFloat` time value and does something with it.\n\nFor most custom animations, you'll want to subclass `Animation` with the specific type of the property you want to interpolate for each keyframe.\n\n```swift\npublic class BorderWidthAnimation : Animation\u003CCGFloat>, Animatable {\n```\n\nCreate a property to store whatever view (or other object) you are applying the animations to, and create an initializer that takes a view as input.\n\n```swift\nprivate let view : UIView\n\npublic init(view: UIView) {\n\tself.view = view\n}\n```\n\nOptionally, you can add a function to validate any input values that will be checked each time a keyframe is added, such as for Alpha values that must range from 0 to 1.\n\n```swift\npublic override func validateValue(_ value: CGFloat) -> Bool {\n\treturn (value >= 0) && (value \u003C= 1)\n}\n```\n\nThen, all you need to do is to make the appropriate changes to your view when the `animate(time:)` function is called.\n\n```swift\npublic func animate(_ time: CGFloat) {\n\tif !hasKeyframes() {return}\n\tview.layer.borderWidth = self[time]\n}\n```\n\nYou can then create an instance of your new Animation in your `UIViewController`, give it the view you'd like to animate, add it to your Animator and set some keyframes as above, and it will animate your custom property when the Animator is told to animate.\n\n### Interpolatable Types\n\n`RazzleDazzle` can animate any type that conforms to the `Interpolatable` protocol. It comes pre-cooked to support animating `CGFloats`, `CGPoints`, `CGSizes`, `CGRects`, and `UIColors`.\n\nIf the property you'd like to animate is of a different type, just extend that type to conform to `Interpolatable` by adding a static function `interpolateFrom(fromValue: toValue: withProgress:)` that returns an instance of that type between two other instances of the same type.\n\n```swift\nextension CGPoint : Interpolatable {\n    public static func interpolateFrom(fromValue: CGPoint, to toValue: CGPoint, withProgress progress: CGFloat) -> CGPoint {\n        assert((0 \u003C= progress) && (progress \u003C= 1), \"Progress must be between 0 and 1\")\n        let interpolatedX = CGFloat.interpolateFrom(fromValue.x, to: toValue.x, withProgress: progress)\n        let interpolatedY = CGFloat.interpolateFrom(fromValue.y, to: toValue.y, withProgress: progress)\n        return CGPointMake(interpolatedX, interpolatedY)\n    }\n}\n```\n\nIf your property is a `CGFloat` or one of the other built-in interpolatable types, you only need to create an animation type that tells `RazzleDazzle` how to apply the keyframe values to your view, as above.\n\n## Notes\n\nAn animator can only handle one animation per type per view. If you want multiple animations of the same type on a view, use keyframes of a single animation instead of two separate animations.\n\n`RazzleDazzle` is written in Swift 3.0, so it will only compile in Xcode 8 and up. If you want to use a library like this that will integrate with an older version of Swift, you can use [`JazzHands`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FJazzHands), which is written in Objective-C, and use a bridging header to access the methods from your Swift 1.2 classes.\n\nLooking for libraries to build awesome keyframe animations like RazzleDazzle on Android? Check out [`SparkleMotion`](https:\u002F\u002Fgithub.com\u002FIFTTT\u002FSparkleMotion).\n\n## Contributors\n\n* [Laura Skelton](https:\u002F\u002Fgithub.com\u002Flauraskelton), creator.\n\n## Contributing\n\n1. Fork it ( https:\u002F\u002Fgithub.com\u002F[my-github-username]\u002FRazzleDazzle\u002Ffork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## License\n\n`RazzleDazzle` is available under the MIT license. See the LICENSE file for more info.\n\nCopyright 2015 IFTTT Inc.\n","RazzleDazzle 是一个基于关键帧的iOS动画框架，使用Swift编写，特别适合用于滚动应用介绍。它支持AutoLayout，并提供了一个简单易用的接口来创建与滚动视图相关的动画效果。此外，RazzleDazzle 还简化了分页滚动视图控制器的布局过程，在不同屏幕尺寸和方向变化时保持良好的响应性。对于希望在自己的Swift应用中添加流畅、专业级滚动动画效果的开发者来说，RazzleDazzle是一个理想的选择。",2,"2026-06-11 03:09:59","top_language"]