{"id":21852762,"url":"https://github.com/brownsoo/valueanimator","last_synced_at":"2025-04-14T16:25:05.392Z","repository":{"id":56364406,"uuid":"124997875","full_name":"brownsoo/ValueAnimator","owner":"brownsoo","description":"Value transition swift utility","archived":false,"fork":false,"pushed_at":"2024-12-10T14:49:54.000Z","size":11111,"stargazers_count":19,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T01:39:14.178Z","etag":null,"topics":["animation","animator","cocoapods","easing-effects","ios","swift","translation","valueanimator"],"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/brownsoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"brownsoo","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-03-13T05:37:11.000Z","updated_at":"2024-12-03T02:59:11.000Z","dependencies_parsed_at":"2022-08-15T17:20:39.824Z","dependency_job_id":null,"html_url":"https://github.com/brownsoo/ValueAnimator","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownsoo%2FValueAnimator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownsoo%2FValueAnimator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownsoo%2FValueAnimator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownsoo%2FValueAnimator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brownsoo","download_url":"https://codeload.github.com/brownsoo/ValueAnimator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248915314,"owners_count":21182604,"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","animator","cocoapods","easing-effects","ios","swift","translation","valueanimator"],"created_at":"2024-11-28T01:18:28.432Z","updated_at":"2025-04-14T16:25:05.357Z","avatar_url":"https://github.com/brownsoo.png","language":"Swift","funding_links":["https://ko-fi.com/brownsoo"],"categories":[],"sub_categories":[],"readme":"# ValueAnimator\n\n[![Version](https://img.shields.io/cocoapods/v/ValueAnimator.svg?style=flat)](http://cocoapods.org/pods/ValueAnimator)\n[![License](https://img.shields.io/cocoapods/l/ValueAnimator.svg?style=flat)](http://cocoapods.org/pods/ValueAnimator)\n[![Platform](https://img.shields.io/cocoapods/p/ValueAnimator.svg?style=flat)](http://cocoapods.org/pods/ValueAnimator)\n[![codebeat badge](https://codebeat.co/badges/ffe86bc0-24d9-4c1d-993c-274d8f803eb5)](https://codebeat.co/projects/github-com-brownsoo-valueanimator-master)\n![actions workflow](https://github.com/brownsoo/ValueAnimator/actions/workflows/swift.yml/badge.svg)\n\n- [ ] Multiple properties in funcion 'onChanged'\n\n## Demo\n\n![Demo for UIView animation](value-animator-example.gif)\n\n## Usage\n\nValueAnimator makes the transition from initial value to target value using easing functions.\n\n#### Simple animation\n\n```swift\nlet animator = ValueAnimator.animate(\"some\", from: 0, to: 360, duration: 1.0,\n    onChanged: { p, v in \n        print(\"property \\(p): \\(v.value)\")\n    },\n    easing: EaseCircular.easeIn())\nanimator.resume()\n```\n\n#### Yoyo annimation with 2 values\n\n```swift\nlet yoyoAni = ValueAnimator.animate(\n    props: [\"h\", \"w\"], \n    from: [20, 30], \n    to: [5, 150], \n    duration: 1.4, \n    easing: EaseSine.easeInOut(), \n    onChanged: { p, v in\n        if p == \"h\" {\n            let width = self.rect1.bounds.width\n            self.rect1.frame = CGRect(x: 24, y: 140, width: width, height:v.cg)\n        } else {\n            let height = self.rect1.bounds.height\n            self.rect1.frame = CGRect(x: 24, y: 140, width:v.cg, height: height)\n        }\n    }, \n    option: ValueAnimator.OptionBuilder()\n        .setYoyo(true)\n        .build())\nyoyoAni.resume()\n```\n\n\n#### Thread\n\nValueAnimator uses its own work-thread. But the callback `changeCallback`, `endCallback` is called in main-thread. if you wanna it called in work-thread, you just set the 'callbackOnMainThread' property is false.\n\n```swift\nlet someView: UIView!\nlet animator = ValueAnimator.animate(\"some\", from: 0, to: 1, duration: 1.0,\n    onChanged: { p, v in \n        // called in ValueAnimator's work-thread\n    },\n    easing: EaseCircular.easeIn())\nanimator.callbackOnMainThread = false\nanimator.resume()\n```\n\n## Example\n\nTo run the example project, clone the repo, and run **open ValueAnimator.xcworkspace**. \nYou can see ValueAnimatorExample project.\n\n## Installation\n\n\n### [Swift Package Manager](https://swift.org/package-manager/)\n\n* Open Xcode\n* Go to File \u003e Swift Packages \u003e Add Package Dependency...\n* Paste this Github Repo URL (https://github.com/brownsoo/ValueAnimator) into the search bar.\n* Select the ValueAnimator repo from the search results.\n\n\n### [CocoaPods](http://cocoapods.org)\n\nSimply add the following line to your Podfile:\n\n```ruby\npod 'ValueAnimator'\n```\n\n## Author\n\nbrownsoo, [@medium](https://medium.com/@brownsoo)\n\n## License\n\nValueAnimator 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%2Fbrownsoo%2Fvalueanimator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrownsoo%2Fvalueanimator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrownsoo%2Fvalueanimator/lists"}