{"id":15030995,"url":"https://github.com/cosmicmind/motion","last_synced_at":"2025-05-15T12:05:08.967Z","repository":{"id":44358599,"uuid":"80641217","full_name":"CosmicMind/Motion","owner":"CosmicMind","description":"A library used to create beautiful animations and transitions for iOS.","archived":false,"fork":false,"pushed_at":"2020-01-28T12:14:33.000Z","size":644,"stargazers_count":1772,"open_issues_count":4,"forks_count":118,"subscribers_count":34,"default_branch":"development","last_synced_at":"2025-05-15T12:05:02.292Z","etag":null,"topics":["animation","cosmicmind","design","ios","material","material-design","swift-3","swift-library","transitions","ui","ux"],"latest_commit_sha":null,"homepage":"http://cosmicmind.com","language":"Swift","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/CosmicMind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-01T16:48:06.000Z","updated_at":"2025-04-09T13:56:16.000Z","dependencies_parsed_at":"2022-08-30T22:31:27.563Z","dependency_job_id":null,"html_url":"https://github.com/CosmicMind/Motion","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FMotion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FMotion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FMotion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FMotion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CosmicMind","download_url":"https://codeload.github.com/CosmicMind/Motion/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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":["animation","cosmicmind","design","ios","material","material-design","swift-3","swift-library","transitions","ui","ux"],"created_at":"2024-09-24T20:14:42.271Z","updated_at":"2025-05-15T12:05:03.630Z","avatar_url":"https://github.com/CosmicMind.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Motion Logo](http://www.cosmicmind.com/motion/logo/motion_logo.png)\n\n# Motion\n\nWelcome to **Motion,** a library used to create beautiful animations and transitions for views, layers, and view controllers.\n\n## Photos Sample\n\nTake a look at a sample [Photos](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Photos) project to get started.\n\n![Photos](http://www.cosmicmind.com/motion/projects/photos.gif)\n\n* [Photos Sample](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Photos)\n\n### Who is Motion for?\n\nMotion is designed for beginner to expert developers. For beginners, you will be exposed to very powerful APIs that would take time and experience to develop on your own, and experts will appreciate the time saved by using Motion.\n\n### What you will learn\n\nYou will learn how to use Motion with a general introduction to fundamental concepts and easy to use code snippets.\n\n# Transitions\n\nMotion transitions a source view to a destination view using a linking identifier property named `motionIdentifier`.\n\n| Match | Translate | Rotate | Arc | Scale |\n|:---:|:---:|:---:|:---:|:---:|\n| ![Match](http://www.cosmicmind.com/motion/transitions_identifier/match.gif) |  ![Translate](http://www.cosmicmind.com/motion/transitions_identifier/translate.gif) | ![Rotate](http://www.cosmicmind.com/motion/transitions_identifier/rotate.gif) | ![Arc](http://www.cosmicmind.com/motion/transitions_identifier/arc.gif) | ![Scale](http://www.cosmicmind.com/motion/transitions_identifier/scale.gif) |\n\n### Example Usage\n\nAn example of transitioning from one view controller to another with transitions:\n\n#### View Controller 1\n\n```swift\ngreyView.motionIdentifier = \"foo\"\norangeView.motionIdentifier = \"bar\"\n```\n\n#### View Controller 2\n\n```swift\nisMotionEnabled = true\ngreyView.motionIdentifier = \"foo\"\norangeView.motionIdentifier = \"bar\"\norangeView.transition(.translate(x: -100))\n```\n\nThe above code snippet tells the source views in `view controller 1` to link to the destination views in `view controller 2` using the `motionIdentifier`. Animations may be added to views during a transition using the **transition** method. The *transition* method accepts MotionTransition structs that configure the view's animation.\n\n* [MotionTransition API](https://cosmicmind.gitbooks.io/motion/content/motion_transition_api.html)\n* [Code Samples](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/TransitionsWithIdentifier)\n\n## UINavigationController, UITabBarController, and UIViewController Transitions\n\nMotion offers default transitions that may be used by UINavigationControllers, UITabBarControllers, and presenting UIViewControllers.\n\n| Push | Slide | ZoomSlide | Cover | Page | Fade | Zoom |\n|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n| ![Push](http://www.cosmicmind.com/motion/transitions/push.gif)  | ![Slide](http://www.cosmicmind.com/motion/transitions/slide.gif)| ![Zoom Slide](http://www.cosmicmind.com/motion/transitions/zoom_slide.gif) | ![Cover](http://www.cosmicmind.com/motion/transitions/cover.gif) | ![Page](http://www.cosmicmind.com/motion/transitions/page_in.gif) | ![Fade](http://www.cosmicmind.com/motion/transitions/fade.gif) | ![Zoom](http://www.cosmicmind.com/motion/transitions/zoom.gif)|\n\n### Example Usage\n\nAn example of transitioning from one view controller to another using a UINavigationController with a zoom transition:\n\n#### UINavigationController\n\n```swift\nclass AppNavigationController: UINavigationController {\n    open override func viewDidLoad() {\n        super.viewDidLoad()\n        isMotionEnabled = true\n        motionNavigationTransitionType = .zoom\n    }\n}\n```\n\nTo add an automatic reverse transition, use `autoReverse`.\n\n```swift\nmotionNavigationTransitionType = .autoReverse(presenting: .zoom)\n```\n\n* [Code Samples](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Transitions)\n\n# Animations\n\nMotion provides the building blocks necessary to create stunning animations without much effort. Motion's animation API will make maintenance a breeze and changes even easier. To create an animation, use the **animate** method of a view or layer and pass in a list of MotionAnimation structs. MotionAnimation structs are configurable values that describe how to animate a property or group of properties.\n\n| Background Color | Corner Radius | Fade | Rotate | Size | Spring |\n|:---:|:---:|:---:|:---:|:---:|:---:|\n| ![Background Color](http://www.cosmicmind.com/motion/animations/background_color.gif) | ![Corner Radius](http://www.cosmicmind.com/motion/animations/corner_radius.gif) | ![Fade](http://www.cosmicmind.com/motion/animations/fade.gif) | ![Rotate](http://www.cosmicmind.com/motion/animations/rotate.gif) | ![Size](http://www.cosmicmind.com/motion/animations/size.gif) | ![Spring](http://www.cosmicmind.com/motion/animations/spring.gif) |\n\n| Border Color \u0026 Border Width | Depth | Position | Scale | Spin | Translate |\n|:---:|:---:|:---:|:---:|:---:|:---:|\n|![Border Color \u0026 Border Width](http://www.cosmicmind.com/motion/animations/border_color.gif) | ![Depth](http://www.cosmicmind.com/motion/animations/depth.gif) | ![Position](http://www.cosmicmind.com/motion/animations/position.gif) | ![Scale](http://www.cosmicmind.com/motion/animations/scale.gif) | ![Spin](http://www.cosmicmind.com/motion/animations/spin.gif) | ![Translate](http://www.cosmicmind.com/motion/animations/translate.gif) |\n\n### Example Usage\n\n```swift\nlet box = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\nbox.backgroundColor = .blue\n\nbox.animate(.background(color: .red), .rotate(180), .delay(1))\n```\n\nIn the above code example, a box view is created with a width of 100, height of 100, and an initial background color of blue. Following the general creation of the view, the _Motion animate_ method is passed _MotionAnimation structs_ that tell the view to animate to a red background color and rotate 180 degrees after a delay of 1 second. That's pretty much the general idea of creating animations.\n\n* [MotionAnimation API](https://cosmicmind.gitbooks.io/motion/content/motion_animation_api.html)\n* [Code Samples](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Animations)\n\n## Requirements\n\n* iOS 8.0+\n* Xcode 8.0+\n\n## Communication\n\n- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cosmicmind). (Tag 'cosmicmind')\n- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cosmicmind).\n- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Installation\n\n\u003e **Embedded frameworks require a minimum deployment target of iOS 8.**\n\u003e - [Download Motion](https://github.com/CosmicMind/Motion/archive/master.zip)\n\n## CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate Motion's core features into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'Motion', '~\u003e 3.1.0'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Carthage\n\nCarthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with Homebrew using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\nTo integrate Motion into your Xcode project using Carthage, specify it in your Cartfile:\n\n```bash\ngithub \"CosmicMind/Motion\"\n```\n\nRun `carthage update` to build the framework and drag the built `Motion.framework` into your Xcode project.\n\n## Change Log\n\nMotion is a growing project and will encounter changes throughout its development. It is recommended that the [Change Log](https://github.com/CosmicMind/Motion/blob/master/CHANGELOG.md) be reviewed prior to updating versions.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (C) 2019, CosmicMind, Inc. \u003chttp://cosmicmind.com\u003e.\nAll rights reserved.\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%2Fcosmicmind%2Fmotion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmicmind%2Fmotion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicmind%2Fmotion/lists"}