{"id":13743132,"url":"https://github.com/jwilling/JNWSpringAnimation","last_synced_at":"2025-05-09T00:32:48.009Z","repository":{"id":8762169,"uuid":"10445148","full_name":"jwilling/JNWSpringAnimation","owner":"jwilling","description":"Spring physics for Core Animation.","archived":false,"fork":false,"pushed_at":"2017-05-31T09:43:00.000Z","size":77,"stargazers_count":1010,"open_issues_count":0,"forks_count":68,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-12T16:53:19.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jwilling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-03T01:50:51.000Z","updated_at":"2025-04-07T13:42:26.000Z","dependencies_parsed_at":"2022-09-08T23:40:36.268Z","dependency_job_id":null,"html_url":"https://github.com/jwilling/JNWSpringAnimation","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilling%2FJNWSpringAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilling%2FJNWSpringAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilling%2FJNWSpringAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilling%2FJNWSpringAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwilling","download_url":"https://codeload.github.com/jwilling/JNWSpringAnimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171166,"owners_count":21865275,"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-08-03T05:00:41.176Z","updated_at":"2025-05-09T00:32:47.764Z","avatar_url":"https://github.com/jwilling.png","language":"Objective-C","readme":"## JNWSpringAnimation ##\n`JNWSpringAnimation` is a subclass of `CAKeyframeAnimation` that adds support for creating damped harmonic animations.\n\n![](http://jwilling.com/serve/github/jnwspringanimation/preview.gif)\n\n## Getting Started ##\nAlthough `JNWSpringAnimation` is a subclass of `CAKeyframeAnimation`, it should be treated as if it were a subclass of `CABasicAnimation`. \n\nTo get started, copy the four source files into your project.\n\nThe animation can be created by using the dedicated initializer, `+animationWithKeyPath:`. Alternatively, the animation can be created using `+animation` and by setting the key path afterwards. The full list of currently-compatible animatable properties is available in the header.\n\n```objc\nJNWSpringAnimation *animation = [JNWSpringAnimation animationWithKeyPath:@\"position.x\"];\n```\n\nNext, the `fromValue` and `toValue` properties must be set for the interpolated values to be calculated correctly.\n\n```objc\nanimation.toValue = @(toX);\nanimation.fromValue = @(currentX);\n```\n\nFinally, the values for the spring constants can optionally be changed. Currently, `stiffness`, `damping`, and `mass` are available for modification.\n\n```objc\nanimation.mass = 30; // this will move extremely slowly\n// and so on\n```\n\nThe animation itself can be applied like any other subclass of `CAAnimation`, namely `-addAnimation:forKey:` on any `CALayer`.\n\n## What's this for? ##\n\nThis was created in my desire to have an open-source version of the (currently private) `CASpringAnimation` which was discovered in iOS 6.\n\nSpring animations, when used appropriately, can really enhance the way your app feels to the user by connecting in physical simulations with an app's interface. And besides, who doesn't love messing around with springs?\n\n## What's left to do? ##\n\nI created this as a weekend project, so the implementation is still somewhat unfinished. Compared to `CASpringAnimation`, the `velocity` property is still unimplemented. Pull requests are welcome.\n\n## License ##\n`JNWSpringAnimation` is licensed under the [MIT](http://opensource.org/licenses/MIT) license. See [LICENSE.md](LICENSE.md).\n\n\n## Get In Touch ##\nYou can follow me on Twitter as [@willing](http://twitter.com/willing), email me at the email listed on my GitHub profile, or read my blog at [jwilling.com](http://www.jwilling.com).\n","funding_links":[],"categories":["Objective-C  Stars 1000以内排名整理","etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilling%2FJNWSpringAnimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwilling%2FJNWSpringAnimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilling%2FJNWSpringAnimation/lists"}