{"id":18270468,"url":"https://github.com/mysterioustrousers/MTAnimation","last_synced_at":"2025-04-05T01:30:37.068Z","repository":{"id":56920826,"uuid":"9842238","full_name":"mysterioustrousers/MTAnimation","owner":"mysterioustrousers","description":"Animate UIView with 25+ timing functions. (Bounce, elastic, exponential, etc.)","archived":false,"fork":false,"pushed_at":"2019-06-03T14:01:10.000Z","size":5852,"stargazers_count":504,"open_issues_count":4,"forks_count":56,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-04-26T06:44:34.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mysterioustrousers.com/news/2013/3/25/visceral-apps-and-you","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mysterioustrousers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-03T18:39:59.000Z","updated_at":"2024-03-05T07:32:47.000Z","dependencies_parsed_at":"2022-08-20T21:50:22.684Z","dependency_job_id":null,"html_url":"https://github.com/mysterioustrousers/MTAnimation","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterioustrousers%2FMTAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterioustrousers%2FMTAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterioustrousers%2FMTAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterioustrousers%2FMTAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mysterioustrousers","download_url":"https://codeload.github.com/mysterioustrousers/MTAnimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276022,"owners_count":20912285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:39.610Z","updated_at":"2025-04-05T01:30:36.549Z","avatar_url":"https://github.com/mysterioustrousers.png","language":"Objective-C","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"MTAnimation\n===========\n\n![](http://img.shields.io/cocoapods/v/MTAnimation.svg?style=flat-square)\n![](http://img.shields.io/cocoapods/l/MTAnimation.svg?style=flat-square)\n![](http://img.shields.io/cocoapods/p/MTAnimation.svg?style=flat-square)\n\nAnimate UIView/NSView with 25+ timing functions. (Bounce, elastic, exponential, etc.)\n\nAllows you to animate views in your app in the way you're familiar with (e.g. `[UIView animateWithDuration:animations:]`) but adds 25+ [easing functions](http://easings.net/) (from jQuery) to make your animations more [visceral](http://mysterioustrousers.com/news/2013/3/25/visceral-apps-and-you).\n\nAdvantages:\n- Methods very similar to Apple's API.\n- No Swizzling.\n- No need to mess with keypaths, just change the properties on UIView and you're golden.\n- Proper transform matrix interpolation, so rotations look correct.\n- Install with cocoapods.\n- Category methods prefixed.\n\n## Installation\n\nIn your Podfile, add this line:\n\n    pod \"MTAnimation\"\n\nThen add the import:\n\n```objc\n// Same import for both iOS/OSX\n#import \u003cUIView+MTAnimation.h\u003e\n```\n\n## Preview\n\n[![Animation Sample](https://dl.dropboxusercontent.com/u/2771219/github/MTAnimation/demo.gif)](https://dl.dropboxusercontent.com/u/2771219/github/MTAnimation/demo.mov)\n\n\n## Example App\n\n#### iOS\n\n* Clone the repo (or download [the zip](https://github.com/mysterioustrousers/MTAnimation/archive/master.zip)) and run the iPad demo app to play around.\n\n#### OSX\n\n* Download and run a developer signed [Mac Example](https://github.com/mysterioustrousers/MTAnimation-Mac-Example/raw/master/MTAnimationMacExample.app.zip)\n\n* Clone the [repo](https://github.com/mysterioustrousers/MTAnimation-Mac-Example) (or download [the zip](https://github.com/mysterioustrousers/MTAnimation-Mac-Example/archive/master.zip)) and build \u0026 run the mac app yourself.\n\n\n## Example Usage\n\nSimilar to the UIKits animation methods but you must supply an array of all the views you will be animating and an easing function.\n\n```objc\n[UIView mt_animateWithViews:@[view]\n                   duration:0.25\n             timingFunction:kMTEaseOutBack\n                 animations:^{\n                     CGRect r             = _logoImageView.frame;\n                     r.origin.x           = 50;\n                     _logoImageView.frame = r;\n                 }];\n```\n\nYou can animate:\n\n```objc\nUIView/NSView - frame\nUIView/NSView - bounds\nUIView        - center\nUIView/NSView - alpha\nUIView        - transform (CGAffineTransform)\nCALayer       - transform (CATransform3D)\n```\n\nYou can cut an animation into parts (using the `range` param). You might use this to swap the view half way through a flip animation:\n\n```objc\n_logoImageView.image = [UIImage imageNamed:@\"logo\"];\n[UIView mt_animateWithViews:[view mt_allSubviews]\n                   duration:0.25\n                      delay:0\n             timingFunction:kMTEaseOutBack\n                      range:MTMakeAnimationRange(0, 0.135)\n                    options:0\n                 animations:^{\n                     CGFloat radians                 = mt_degreesToRadians(_endRotation);\n                     _logoImageView.layer.transform  = CATransform3DMakeRotation(radians, 0, 1, 0);\n                 } completion:^{\n                     _logoImageView.image = [UIImage imageNamed:@\"logo-flip\"];\n                     [UIView mt_animateWithWithViews:[view mt_allSubviews]\n                                            duration:0.25\n                                               delay:0\n                                      timingFunction:kMTEaseOutBack\n                                               range:MTMakeAnimationRange(0.135, 1)\n                                             options:0\n                                          animations:^{\n                                              CGFloat radians                 = mt_degreesToRadians(_endRotation);\n                                              _logoImageView.layer.transform  = CATransform3DMakeRotation(radians, 0, 1, 0);\n                                          } completion:^{\n                                          }];\n                 }];\n```\n\nThis code will animate until the image is sideways, then swap out the image view's image and continue the animation so it looks like it has a backside.\n\n\n## Notes\n\n* The view you animate must be layer backed. See `[NSView setWantsLayer:]`.\n\n## Author\n\n[Adam Kirk](https://github.com/atomkirk) ([@atomkirk](https://twitter.com/atomkirk))\n\n## Contributing\n\nI have `TODO:` comments on stuff I need some help with, so feel free.\n\n## Credits\n\nInspired by [Nocho Soto's NSBKeyframeAnimation Library](https://github.com/NachoSoto/NSBKeyframeAnimation)\n\nCode extracts from [Ivan VuÄica \u0026 Amr Aboelela work on CAAnimation](http://svn.gna.org/svn/gnustep/libs/quartzcore/trunk/Source/CAAnimation.m)\n\n[Easing functions](http://easings.net/) from [jQuery](http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js)\n\n## License\n\nCopyright (c) 2010 Mysterious Trousers, LLC (http://www.mysterioustrousers.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysterioustrousers%2FMTAnimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmysterioustrousers%2FMTAnimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysterioustrousers%2FMTAnimation/lists"}