{"id":15561291,"url":"https://github.com/gbammc/morph","last_synced_at":"2026-03-13T09:31:56.670Z","repository":{"id":62448021,"uuid":"78256276","full_name":"gbammc/Morph","owner":"gbammc","description":"A wrapper for CoreAnimation (Swift).","archived":false,"fork":false,"pushed_at":"2017-10-27T05:08:44.000Z","size":278,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T02:16:28.582Z","etag":null,"topics":["animation","cakeyframeanimation","carthage","cocoapods","coreanimation","framework","ios","swift3"],"latest_commit_sha":null,"homepage":"","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/gbammc.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":"2017-01-07T03:32:41.000Z","updated_at":"2024-07-08T09:33:57.000Z","dependencies_parsed_at":"2022-11-02T01:01:19.500Z","dependency_job_id":null,"html_url":"https://github.com/gbammc/Morph","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbammc%2FMorph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbammc%2FMorph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbammc%2FMorph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbammc%2FMorph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbammc","download_url":"https://codeload.github.com/gbammc/Morph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528683,"owners_count":21445511,"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","cakeyframeanimation","carthage","cocoapods","coreanimation","framework","ios","swift3"],"created_at":"2024-10-02T16:07:03.596Z","updated_at":"2026-03-13T09:31:56.631Z","avatar_url":"https://github.com/gbammc.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morph\n\n[![Version](https://img.shields.io/cocoapods/v/Morph.svg?style=flat)](http://cocoapods.org/pods/Morph) [![License](https://img.shields.io/cocoapods/l/Morph.svg?style=flat)](http://cocoapods.org/pods/Morph) [![Platform](https://img.shields.io/cocoapods/p/Morph.svg?style=flat)](http://cocoapods.org/pods/Morph) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![Xcode 8.2+](https://img.shields.io/badge/Xcode-8.2%2B-blue.svg) ![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg) [![Language Swift 3.0.1](https://img.shields.io/badge/Language-Swift%203.0.1-orange.svg)](https://swift.org)\n\n## Introduction\n\nMorph wraps CoreAnimation with a nicer syntax to help you build up awesome animations ([Objective-C version](https://github.com/gbammc/Mystique)).\n\n## Demo\n\n![demo](/Resources/demo.gif?raw=true)\n\nTo implement above layer effect, all you need to code:\n\n```swift\n// Radiation\nradiation.mr_startAnimations({ (animate) in\n    animate.opacity.from(1).to(0).animate(duration)\n    animate.scale.from(1).to(0).animate(duration)\n    animate.center.from(fromPoint).to(toPoint).animate(duration)\n}, completion: {\n    radiation.removeFromSuperlayer()\n})\n\n// Background circle\ncircle.mr_startAnimations({ (animate) in\n    animate.scale.by([0.8, scale, scale]).during([0, 0.5, 1.0]).animate(duration)\n    animate.opacity.from(0.5).to(0).animate(duration)\n}, completion: {\n    circle.removeFromSuperlayer()\n})\n```\n\nCheck out the __Morph iOS Examples__ to get more details.\n\n## Installation\n\n### Cocoapods\n\nMorph is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod \"Morph\"\n```\n\n### Carthage\n\nYou can also use [Carthage](https://github.com/Carthage/Carthage) to install Morph by adding that to your Cartfile:\n\n```ruby\ngithub \"gbammc/Morph\"\n```\n\n## Getting started\n\n### Basic usage\n\n```swift\n// Compose your animations in here.\nview.mr_startAnimations({ (animate) in\n    animate.x.to(100).animate(1)\n    animate.backgroundColor\n        .to(UIColor.red).after(0.4)\n        .delay(0.2).to(UIColor.yellow).animate(0.4)\n})\n```\n\n### Attributes\n\n#### Basic attributes\n\n| Attribute | keyPath |\n|-----------|---------|\n| bounds | bounds |\n| size | bounds.size |\n| origin | position |\n| center | position |\n| x | position.x |\n| y | position.y |\n| width | bounds.size.width |\n| height | bounds.size.height |\n| opacity | opacity |\n| backgroundColor | backgroundColor |\n| borderColor | borderColor |\n| borderWidth | borderWidth |\n| cornerRadius | cornerRadius |\n| anchor | anchorPoint |\n| path | position |\n\n#### Advance attributes\n\n| Attribute | keyPath | Description |\n|-----------|---------|-------------|\n| scale | transform.scale |  Idempotent |\n| scaleX | transform.scale.x | Idempotent |\n| scaleY | transform.scale.y | Idempotent |\n| rotateX | transform.rotation.x | Accept degree value. Idempotent |\n| rotateY | transform.rotation.y | Accept degree value. Idempotent |\n| rotateZ | transform.rotation.z | Accept degree value. Idempotent |\n| rotate | transform.rotation.z | The same as ```rotateZ``` |\n| xOffset | position.x | Increase / decrease origin x by specific value |\n| yOffset | position.y | Increase / decrease origin y by specific value |\n| heightOffset | bounds.size.width | Increase / decrease width by specific value |\n| widthOffset | bounds.size.height | Increase / decrease height by specific value |\n| rotateOnPath | position | Animating along paths rotate to match the path tangent  |\n| reverseRotateOnPath | position | Animating along paths rotate to match the path tangent and auto reverse |\n| fillColor | fillColor | CAShapeLayer only |\n| strokeColor | strokeColor | CAShapeLayer only |\n| strokeStart | strokeStart | CAShapeLayer only |\n| strokeEnd | strokeEnd | CAShapeLayer only |\n| lineWidth | lineWidth | CAShapeLayer only |\n| miterLimit | miterLimit | CAShapeLayer only |\n| lineDashPhase | lineDashPhase | CAShapeLayer only |\n\n#### Chaining Animations\n\nAn attribute should ended by __animate(duration)__ function.\n\n```swift\nanimate.width.to(100).animate(1.0)\n```\n\nTo chain an attribute with different values in different time can call __after(duration)__ function.\n\n```swift\nanimate.x.to(50).after(1.0).to(200).animate(2.0)\n```\n\nTo delay an animation call the __delay(duration)__ function.\n\n```swift\n// it will disappear in one second and appear again after two second delay\nanimate.opacity\n    .to(0.0).after(1.0)\n    .delay(2.0).to(1.0).animate(1.0)\n```\n\n#### Repeat and autoreverse\n\nTo repeat or autoreverse animations with the __repeat(times)__, __repeatInfinity()__ and __autoreverse()__ functions.\n\n#### Use it like CAKeyframeAnimation\n\nBelow is an example of how to set values and key times like CAKeyframeAnimation.\n\n```swift\nanimate.scale\n\t.by([0.8, 1, 1])\n\t.during([0, 0.5, 1.0])\n\t.animate(duration)\n\n/* the same as:\nCAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@\"transform.scale\"];\nkeyframeAnimation.values = @[ @0.0, @1.1, @1.0 ];\nkeyframeAnimation.keyTimes = @[ @0.0, @0.5, @1.0 ];\nkeyframeAnimation.duration = duration;\n*/\n```\n\n### Debug\n\nSet ```logEnable``` to ```true``` will print the animations details for you to debug.\n\n```swift\nanimate.logEnable = true\n```\n\n## Credit\n\nThanks their incredible works!\n\n[JHChainableAnimations](https://github.com/jhurray/JHChainableAnimations)\n\n[Masonry](https://github.com/SnapKit/Masonry)\n\n## License\n\nMorph is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbammc%2Fmorph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbammc%2Fmorph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbammc%2Fmorph/lists"}