[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7045":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},7045,"EasyAnimation","icanzilb\u002FEasyAnimation","icanzilb","A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!","",null,"Swift",2931,197,67,9,0,58.89,"MIT License",false,"master",true,[],"2026-06-12 04:00:32","![](etc\u002FEA.png)\n\n#### ver 2.0\n\n**NB!** _Breaking changes_ in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You **need** to enable it by calling `EasyAnimation.enable()` somewhere in your code (AppDelegate is a good idea).\n\n_The library doesn't use any private APIs - apps using it should be fine for release on the App Store._\n\n\u003Ctable width=\"100%\">\n\u003Ctr>\n\u003Ctd width=\"300\">\n\u003Ca href=\"#intro\">Intro\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#layers\">Layer Animations\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#springs\">Spring Layer Animations\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#chains\">Chain Animations\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#stop\">Cancel Chain Animations\u003C\u002Fa>\u003Cbr>\n\u003C\u002Ftd>\n\u003Ctd width=\"300\">\n\u003Ca href=\"#installation\">Installation\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#credit\">Credit\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#license\">License\u003C\u002Fa>\u003Cbr>\n\u003Ca href=\"#version\">Version History\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\u003Ca name=\"intro\">\u003C\u002Fa>\nIntro\n========\n\n`UIView.animateWithDuration:animations:` is really easy to use and you're so familiar with its syntax that you often want it to do just a bit more for you automatically. But it doesn't and you need to import *Bloated.framework* by *Beginner Ninja Coder* in order to make a bit more advanced animations than what `animateWithDuration:animations:` allows you to.\n\n**EasyAnimation** extends what UIKit offers in terms of animations and makes your life much easier because you can do much more without learning some perky new syntax.\n\nIn version 2.0 and higher to enable all EasyAnimation features you need to run **once** this code - AppDelegate is a good place since it'll enable EasyAnimation as soon as your app starts.\n\n\u003Cpre lang=\"Swift\">\n    EasyAnimation.enable()\n\u003C\u002Fpre>\n\nIn your other classes you don't need to import EasyAnimation or do anything else. Once you call `enable()` afterwards you use the normal UIKit APIs like usual.\n\n\u003Ca name=\"layers\">\u003C\u002Fa>\nEasy Layer Animations\n========\n\n**EasyAnimation** allows you to animate your layers straight from `animate(duration:animations:...)`. No more `CABasicAnimation` code for you. Just adjust the properties of your layers from within the `animations` block and **EasyAnimation** will take care of the rest:\n\u003Ctable width=\"100%\">\n\u003Cth>CoreAnimation (before)\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    let anim = CABasicAnimation(keyPath: \"position.x\")\n    anim.fromValue = 100.0\n    anim.toValue = 200.0\n    anim.duration = 2.0\n    view.layer.addAnimation(anim, forKey: nil)\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003Ctable width=\"100%\">\n\u003Cth>EasyAnimation (after)\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    UIView.animate(duration: 2.0, animations: {\n        self.view.layer.position.x = 200.0\n    })\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n![](etc\u002FmoveX.gif)\n\n(OK, this example actually works fine also without EasyAnimation but I still keep it here for illustrative purpose)\n\nOr if you need to specify delay, animation options and\u002For animation curve:\n\n\u003Ctable width=\"100%\">\n\u003Cth>CoreAnimation (before)\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    let anim = CABasicAnimation(keyPath: \"position.x\")\n    anim.fromValue = 100.0\n    anim.toValue = 200.0\n    anim.duration = 2.0\n    anim.fillMode = kCAFillModeBackwards\n    anim.beginTime = CACurrentMediaTime() + 2.0\n    anim.timingFunction = CAMediaTimingFunction(name: \n        kCAMediaTimingFunctionEaseOut)\n    anim.repeatCount = Float.infinity\n    anim.autoreverses = true\n    view.layer.addAnimation(anim, forKey: nil)\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003Ctable width=\"100%\">\n\u003Cth>EasyAnimation (after)\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    UIView.animate(duration: 2.0, delay: 2.0, \n        options: [.repeat, .autoreverse, .curveEaseOut], \n        animations: {\n        self.view.layer.position.x += 200.0\n\n        \u002F\u002F let's add more animations \n        \u002F\u002F to make it more interesting!\n        self.view.layer.cornerRadius = 20.0\n        self.view.layer.borderWidth = 5.0\n    }, completion: nil)\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n![](etc\u002Fcorners.gif)\n\nAnd if you want to execute a piece of code after the animation is completed - good luck setting up your animation delegate and writing the delegate methods. \n\nWith **EasyAnimation** you just put your code as the `completion` parameter value and **EasyAnimation** executes it for you when your animation completes.\n\n\u003Ca name=\"springs\">\u003C\u002Fa>\n\nSpring Layer Animations\n========\nOne thing I really missed since iOS9 when using CoreAnimation and `CABasicAnimation` was that there was no easy way to create spring animations. Luckily a handy library called `RBBAnimation` provides an excellent implementation of spring animations for layers - I translated the code to Swift and included `RBBSpringAnimation` into `EasyAnimation`. \n\nEasy Animation takes care to use the new in iOS9 spring animation class `CASpringAnimation` when your app runs on iOS9 or higher and falls back to `RBBSpringAnimation` when your app runs on iOS8.\n\nHere's how the code to create a spring animation for the layer position, transform and corner radius looks like:\n\n\u003Ctable width=\"100%\">\n\u003Cth>EasyAnimation\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    UIView.animate(duration: 2.0, delay: 0.0, \n      usingSpringWithDamping: 0.25, \n      initialSpringVelocity: 0.0, \n      options: [], \n      animations: {\n        self.view.layer.position.x += 200.0\n        self.view.layer.cornerRadius = 50.0\n        self.view.layer.transform = CATransform3DMakeScale(1.2, 1.2, 1.0)\n    }, completion: nil)\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n![](etc\u002Fspring.gif)\n\n[Sam Davies](https:\u002F\u002Fgithub.com\u002Fsammyd) collaborated on the spring animations code. Thanks a ton - I couldn't have figured this one on my own!\n\n\u003Ca name=\"chains\">\u003C\u002Fa>\n\nChain Animations\n========\n\n`animate(duration:animations:..)` is really handy but chaining one animation after another is a major pain (especially if we are talking about more than 2 animations).\n\n**EasyAnimation** allows you to use a method to just chain two or more animations together.  Call `animateAndChain(duration:delay:options:animations:completion:)` and then chain to it more animations. Use `animate(duration:animations...)` or any other method to create chained animations.\n\n\u003Ctable width=\"100%\">\n\u003Cth>EasyAnimation\u003C\u002Fth>\n\u003Ctr>\n\u003Ctd valign=\"top\">\n\u003Cpre lang=\"Swift\">\n    UIView.animateAndChain(duration: 1.0, delay: 0.0, \n      options: [], animations: {\n        self.view.center.y += 100\n    }, completion: nil).animate(duration: 1.0, animations: {\n        self.view.center.x += 100\n    }).animate(duration: 1.0, animations: {\n        self.view.center.y -= 100\n    }).animate(duration: 1.0, animations: {\n        self.view.center.x -= 100\n    })\n\u003C\u002Fpre>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n![](etc\u002Fchain.gif)\n\n*Yes - that works, give it a try in your project :]*\n\nThis code will animate the view along a rectangular path - first downwards, then to the right, then up, then to the initial point where the animation started.\n\nWhat a perfect oportunity to repeat the animation and make the animation run continuosly! Add `options` parameter to the last `animate(duration:...` in the chain and turn on the `.repeat` option. \n\nThis will make the whole chain (e.g. the 4 animations) repeat continuously.\n\nIf you want to pause between any two animations in the chain - just use the `delay` parameter and it will all just work.\n\n**Note**: `animateAndChain` does not create a serial queue to which you could add animations at any time. You schedule your animations once with one call like the example above and it runs on its own, you can't add or remove animations to and from the sequence.\n\n\u003Ca name=\"stop\">\u003C\u002Fa>\n\nCancel Chain Animations\n========\n\nIf you have a repeating (or a normal) chain animation on screen you can cancel it at any time. Just grab hold of the animation object and call `cancelAnimationChain` on it any time you want.\n\n\u003Cpre lang=\"Swift\">\nlet chain = UIView.animateAndChain(duration: 1.0, delay: 0.0,\n    options: [], animations: {\n        self.square.center.y += 100\n    }, completion: nil).animate(duration: 1.0, animations: {\n  [... the rest of the animations in the chain]\n\u003C\u002Fpre>\n\n\u003Cpre lang=\"Swift\">\nchain.cancelAnimationChain()\n\u003C\u002Fpre>\n\nIf you want to do some cleanup after the animation chain is cancelled provide a block of code to the `cancelAnimationChain` method:\n\n\u003Cpre lang=\"Swift\">\nchain.cancelAnimationChain({\n  self.myView.center = initialPosition\n  \u002F\u002Fetc. etc.\n})\n\u003C\u002Fpre>\n\n\nThe animation will not stop immediately but once it completes the current step of the chain it will stop and cancel all scheduled animations in this chain.\n\n\u003Ca name=\"installation\">\u003C\u002Fa>\n\nInstallation\n========\n\n* __CocoaPods__: Add to your project's **Podfile**:\n\n`pod 'EasyAnimation'`\n\n* __Carthage__: If you can help with Cartage support let me know.\n\n* __Source code__: To install with the source code - clone this repo or download the source code as a zip file. Include all files within the `EasyAnimation` folder into your project.\n\n\u003Ca href=\"credit\">\u003C\u002Fa>\n\nCredit\n========\n\nAuthor: **Marin Todorov**\n\n* [http:\u002F\u002Fwww.underplot.com](http:\u002F\u002Fwww.underplot.com)\n* [https:\u002F\u002Ftwitter.com\u002Ficanzilb](https:\u002F\u002Ftwitter.com\u002Ficanzilb)\n\nMore about Marin:\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd>\n\u003Ca href=\"http:\u002F\u002Fwww.ios-animations-by-tutorials.com\u002F\">\u003Cimg src=\"http:\u002F\u002Fwww.underplot.com\u002Fimages\u002Fthumbs\u002Fiat.jpg\" width=\"170\">\u003Cbr>\n\u003Cb>iOS Animations by Tutorials\u003C\u002Fb>, Author\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ca href=\"http:\u002F\u002Fwww.ios-animations-by-emails.com\u002F\">\u003Cimg src=\"http:\u002F\u002Fwww.underplot.com\u002Fimages\u002Fthumbs\u002Fios-animations-by-emails.jpg\" width=\"170\">\u003Cbr>\niOS Animations by Emails Newsletter, Author\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nIncludes parts of [RBBAnimation](https:\u002F\u002Fgithub.com\u002Frobb\u002FRBBAnimation) by [Robert Böhnke](https:\u002F\u002Fgithub.com\u002Frobb). The code is translated from Objective-C to Swift by Marin Todorov.\n\nCollaborator on the spring animation integration: [Sam Davies](https:\u002F\u002Fgithub.com\u002Fsammyd).\n\n\u003Ca name=\"license\">\u003C\u002Fa> \n\nLicense\n========\n`EasyAnimation` is available under the MIT license. See the LICENSE file for more info.\n\n`RBBAnimation` license: [https:\u002F\u002Fgithub.com\u002Frobb\u002FRBBAnimation\u002Fblob\u002Fmaster\u002FLICENSE](https:\u002F\u002Fgithub.com\u002Frobb\u002FRBBAnimation\u002Fblob\u002Fmaster\u002FLICENSE)\n\n\u003Ca name=\"version\">\u003C\u002Fa>\n\nTo Do\n=========\n\n* `.autoreverse` for chain animations (if possible)\n* add support for keyframe animation along the path via a custom property\n  \nVersion History\n========\n\n* 2.0 - `initialize()` is deprecated so in need of manual initialization\n * 1.1 - Xcode 8\n* 1.0.5 - Xcode 7.3 compatibility \n* 1.0.4 - Swift 3 compatibility changes\n* 1.0.2 - Fixes openGL view crashes for everyone\n* 1.0.1 - Bug fixes\n* 1.0 - Swift 2.0 and iOS9\n* 0.7 - round of bug fixes and a number of improvements\n* 0.6 - first beta version\n","EasyAnimation 是一个 Swift 库，旨在增强 UIView 动画功能，支持图层动画、弹簧效果、可链接的动画以及视图和图层动画的混合。其核心功能包括简化 Core Animation 的使用流程，使得开发者可以直接通过熟悉的 `UIView.animate` 语法来实现复杂的图层动画效果，而无需编写繁琐的 `CABasicAnimation` 代码。此外，EasyAnimation 还引入了链式调用机制，便于创建连续或并行动画序列，并且能够轻松地取消这些动画。该库非常适合需要在 iOS 应用中添加丰富交互体验或高级视觉效果的场景，同时保证了与 App Store 发布要求的兼容性。",2,"2026-06-11 03:10:15","top_language"]