{"id":2341,"url":"https://github.com/onurersel/anim","last_synced_at":"2025-04-04T19:14:35.546Z","repository":{"id":43393735,"uuid":"49717444","full_name":"onurersel/anim","owner":"onurersel","description":"Swift animation library for iOS, tvOS and macOS.","archived":false,"fork":false,"pushed_at":"2021-03-09T04:35:34.000Z","size":5761,"stargazers_count":569,"open_issues_count":1,"forks_count":46,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-30T08:17:59.348Z","etag":null,"topics":["animation","animation-library","carthage","cocoapods","ios","macos","swift-animation","swift4","tvos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"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/onurersel.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":"2016-01-15T12:26:07.000Z","updated_at":"2024-08-29T17:47:54.000Z","dependencies_parsed_at":"2022-07-09T08:16:10.626Z","dependency_job_id":null,"html_url":"https://github.com/onurersel/anim","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onurersel%2Fanim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onurersel%2Fanim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onurersel%2Fanim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onurersel%2Fanim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onurersel","download_url":"https://codeload.github.com/onurersel/anim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"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","animation-library","carthage","cocoapods","ios","macos","swift-animation","swift4","tvos"],"created_at":"2024-01-05T20:16:11.321Z","updated_at":"2025-04-04T19:14:35.524Z","avatar_url":"https://github.com/onurersel.png","language":"Swift","readme":"\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/logo.png\" alt=\"anim: Swift animation library for iOS, tvOS and macOS.\" width=\"446\"\u003e\n\n-----\n[![CocoaPods](https://img.shields.io/cocoapods/v/anim.svg)](https://cocoapods.org/pods/anim)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Build Status](https://travis-ci.org/onurersel/anim.svg?branch=master)](https://travis-ci.org/onurersel/anim)\n[![codecov.io](https://codecov.io/github/onurersel/anim/coverage.svg?branch=master)](https://codecov.io/github/onurersel/anim?branch=master)\n[![codebeat badge](https://codebeat.co/badges/67e95eda-c701-43d0-921c-541a427750bd)](https://codebeat.co/projects/github-com-onurersel-anim)\n\n\n`anim` is an animation library written in Swift with a simple, declarative API in mind.\n\n```swift\n// moves box to 100,100 with default settings\nanim {\n    self.box.frame.origin = CGPoint(x:100, y:100)\n}\n// after that, waits 100 ms\n.wait(0.1)\n// moves box to 0,0 after waiting\n.then {\n    self.box.frame.origin = CGPoint(x:0, y:0)\n}\n// displays message after all animations are done\n.callback {\n    print(\"Just finished moving 📦 around.\")\n}\n```\n\nIt supports a bunch of easing functions and chaining multiple animations. It's a wrapper on Apple's `UIViewPropertyAnimator` on its core, and falls back to `UIView.animate` on versions before iOS and tvOS 10.\nIt uses `NSAnimationContext` on macOS.\n\n#### Examples\n\nExample projects are available at `examples/` folder and as targets on XCode project.\n\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/example-bonfire.gif\"  align=\"left\" alt=\"Bonfire\" width=\"135\"\u003e\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/example-profile.gif\"  align=\"left\" alt=\"Profile\" width=\"135\"\u003e\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/example-menu.gif\"  align=\"left\" alt=\"Menu\" width=\"135\"\u003e\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/example-message.gif\"  alt=\"Message\" width=\"135\"\u003e\n\n---\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/installation.png\" alt=\"Installation\" width=\"293\"\u003e\n\n#### Cocoapods\n\n```ruby\npod 'anim'\n```\n\n#### Carthage\n\n```ogdl\ngithub \"onurersel/anim\"\n```\n\n#### Manually\n\nOr simply drag the swift files inside `src/` folder into your project.\n\n---\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/api.png\" alt=\"API\" width=\"127\"\u003e\n\nFor complete documentation, visit [http://onurersel.github.io/anim/](http://onurersel.github.io/anim/).\n\nInitialize animations with `anim` constructor.\n\n```swift\n// Initialize with default settings\nanim {\n    // animation block\n}\n```\n\n```swift\n// or initialize with it's own settings\nanim { (settings) -\u003e (animClosure) in\n    settings.delay = 1\n    settings.duration = 0.7\n    settings.ease = .easeInOutBack\n\n    return {\n        // animation block\n    }\n}\n```\n\n```swift\n// or initialize layout constraint animations just by passing the parent view\nanim(constraintParent: self.view) {\n    // animation block\n}\n\nanim(constraintParent: self.view) { (settings) -\u003e (animClosure) in\n    // settings...\n    return {\n        // animation block\n    }\n}\n\n// you don't need to call layoutIfNeeded() before or inside the\n// animation blocks, it's handled by anim\n//\n// for example to update constant value of a constraint,\n// you can just change it inside the animation block\nlet width: NSLayoutConstraint //...\nanim(constraintParent: self.view) {\n    width.constant = 100 // new value\n}\n// that's it!\n```\n\nChain animations with `then` function.\n\n```swift\nanim {}\n.then{\n    // next animation block\n}\n```\n\n```swift\nanim {}\n.then { (settings) -\u003e animClosure in\n    settings.duration = 1\n    return {\n        // next animation block\n    }\n}\n```\n\n```swift\nanim {}\n.then(constraintParent: self.view) {\n    // chaining constraint animations\n}\n.then(constraintParent: self.view) { (settings) -\u003e animClosure in\n    settings.duration = 1\n    return {\n        // next animation block for constraints\n    }\n}\n```\n\nWait between animation steps with `wait` function.\n\n```swift\nanim{}.wait(0.25).then{} //...\n```\n\nInsert callbacks between animation steps with `.callback` function.\n\n```swift\nanim{}\n.callback {\n    // custom block\n}\n.then{} //...\n```\n\nStop animations with `stop` function.\n\n```swift\nlet animation = anim{}.then{} // ...\nanimation.stop()\n```\n\n#### Default settings\n\nYou can change default animation settings through `anim.defaultSettings` property.\n\n```swift\nanim.defaultSettings.ease = .easeInOutCubic\n```\n\n#### Easing\n\n`anim.Ease` exposes a bunch of easing options.\n\n---\n\u003cimg src=\"https://github.com/onurersel/anim/raw/master/img/license.png\" alt=\"License\" width=\"163\"\u003e\n\n`anim` is released under the MIT license. See LICENSE for details.\n","funding_links":[],"categories":["UI"],"sub_categories":["Animation","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonurersel%2Fanim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonurersel%2Fanim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonurersel%2Fanim/lists"}