{"id":13467270,"url":"https://github.com/ataugeron/SpriteKit-Spring","last_synced_at":"2025-03-26T01:30:37.470Z","repository":{"id":20771734,"uuid":"24056504","full_name":"ataugeron/SpriteKit-Spring","owner":"ataugeron","description":"SpriteKit API reproducing UIView's spring animations with SKAction","archived":false,"fork":false,"pushed_at":"2020-11-08T03:33:38.000Z","size":74,"stargazers_count":251,"open_issues_count":4,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-22T12:16:34.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ataugeron.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":"2014-09-15T12:59:40.000Z","updated_at":"2025-02-13T04:59:07.000Z","dependencies_parsed_at":"2022-08-07T09:16:17.234Z","dependency_job_id":null,"html_url":"https://github.com/ataugeron/SpriteKit-Spring","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ataugeron%2FSpriteKit-Spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ataugeron%2FSpriteKit-Spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ataugeron%2FSpriteKit-Spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ataugeron%2FSpriteKit-Spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ataugeron","download_url":"https://codeload.github.com/ataugeron/SpriteKit-Spring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571698,"owners_count":20637376,"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-07-31T15:00:54.634Z","updated_at":"2025-03-26T01:30:37.199Z","avatar_url":"https://github.com/ataugeron.png","language":"Swift","funding_links":[],"categories":["Libs","Utility [🔝](#readme)"],"sub_categories":["Utility"],"readme":"SpriteKit-Spring\n================\n\nSpriteKit-Spring is a set of extensions to perform spring animations with SpriteKit.\n\n## Installation\n\n### iOS 7\n\nIf you need to support iOS 7, you can just drop [SpriteKit-Spring.swift](SpriteKit-Spring.swift) in your project.\n\n### iOS 8\n\nIf you support iOS 8 only, you can install SpriteKit-Spring as a framework with [CocoaPods](https://cocoapods.org) (version 0.36 or above) by adding the following lines to your ```Podfile```:\n\n```\nuse_frameworks!\n\npod 'SpriteKit-Spring'\n```\n\nYou then need to import SpriteKit-Spring wherever you want to use it:\n\n#### Swift:\n```swift\nimport SpriteKit_Spring\n```\n#### Objective-C:\n```objective-c\n#import \u003cSpriteKit_Spring/SpriteKit_Spring-Swift.h\u003e\n```\n\n## Usage\n\nIn iOS 7, Apple introduced spring animations in UIKit by adding a new animation method on UIView (see [WWDC video](https://developer.apple.com/videos/wwdc/2014/#221) and [UIView documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/occ/clm/UIView/animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:)).\n\nThis library replicates this feature by adding a spring variant to most factory methods of SKAction. The parameters ```usingSpringWithDamping:``` and ```initialSpringVelocity:``` have the same meaning as their UIKit counterpart. See below for examples.\n\n## Examples\n\n### Move\n\n```swift\nlet move = SKAction.moveByX(0, y: 200, \n  duration: 5, delay: 5,\n  usingSpringWithDamping: 0.2, initialSpringVelocity: 0)\n  \nnode.runAction(move)\n```\n\n![Move](https://ataugeron.github.io/SpriteKit-Spring/bounce_1.gif)\n\n### Scale\n\n```swift\nlet scale = SKAction.scaleXTo(2, y: 0.5,\n  duration: 5, delay: 5,\n  usingSpringWithDamping: 0.2, initialSpringVelocity: 0)\n  \nnode.runAction(scale)\n```\n\n![Scale](https://ataugeron.github.io/SpriteKit-Spring/bounce_2.gif)\n\n### Rotate\n\n```swift\nlet rotate = SKAction.rotateByAngle(CGFloat(M_PI/2),\n  duration: 5, delay: 5,\n  usingSpringWithDamping: 0.2, initialSpringVelocity: 0)\n  \nnode.runAction(rotate)\n```\n\n![Rotate](https://ataugeron.github.io/SpriteKit-Spring/bounce_3.gif)\n\n## Notes\n\n- Because they use ```customActionWithDuration:actionBlock:```, none of these actions is reversible (the reverse action performs the same animation).\n- All these factory methods are based on the lower level ```animateKeyPath:byValue:duration:delay:usingSpringWithDamping:initialSpringVelocity:``` and ```animateKeyPath:toValue:duration:delay:usingSpringWithDamping:initialSpringVelocity:``` methods, which can animate any CGFloat key path. If you have a SKNode subclass with a fancy CGFloat property that you'd like to animate, feel free to use these methods!\n\n## Creator\n\n- [Alexis Taugeron](http://alexistaugeron.com) ([@ataugeron](https://twitter.com/ataugeron))\n\n## License\n\nSpriteKit-Spring is released under the Apache 2 license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fataugeron%2FSpriteKit-Spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fataugeron%2FSpriteKit-Spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fataugeron%2FSpriteKit-Spring/lists"}