{"id":23143110,"url":"https://github.com/cleancocoa/loopinganimation","last_synced_at":"2025-10-19T07:24:10.530Z","repository":{"id":87401428,"uuid":"119152096","full_name":"CleanCocoa/LoopingAnimation","owner":"CleanCocoa","description":"macOS NSAnimation loops","archived":false,"fork":false,"pushed_at":"2023-12-28T18:02:04.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-12-28T19:23:34.000Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleanCocoa.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-27T09:50:36.000Z","updated_at":"2023-12-28T19:23:35.482Z","dependencies_parsed_at":null,"dependency_job_id":"30fc53c5-db26-4c50-b0ea-1d4c900f5be5","html_url":"https://github.com/CleanCocoa/LoopingAnimation","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FLoopingAnimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FLoopingAnimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FLoopingAnimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FLoopingAnimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanCocoa","download_url":"https://codeload.github.com/CleanCocoa/LoopingAnimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230136123,"owners_count":18178813,"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-12-17T15:12:11.042Z","updated_at":"2025-10-19T07:24:05.479Z","avatar_url":"https://github.com/CleanCocoa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoopingAnimation\n\n![Swift 4.2](https://img.shields.io/badge/Swift-4.2-blue.svg?style=flat)\n![Version](https://img.shields.io/github/tag/CleanCocoa/LoopingAnimation.svg?style=flat)\n![License](https://img.shields.io/github/license/CleanCocoa/LoopingAnimation.svg?style=flat)\n![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg?style=flat)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nConvenience types to configure two `NSAnimation`s to loop infinitely.\n\n## Types\n\n- `SmoothAnimation` is an `NSAnimation` that reports progress continuously instead of only reporting progress marks that'd result in jagged animations.\n- `AnimationLoop` handles `SmoothAnimation` callbacks to create a loop of two animations. You can configure the **increase** and **decrease** animation's durations and animation curves with `AnimationLoop.LoopConfiguration` or through the convenience initializer.\n- `ValueAnimationLoop` wraps `AnimationLoop`, which progresses from 0.0 to 1.0, and instead forwards progress from 0.0 up to its `value`. You can use this to animate offsets from 0 to +100, or from 0 to -100, but not from -100 to +100. It always starts at 0.\n\n## Installation\n\nThis repository is Carthage compatible.\n\nBut the overhead of compiling these few classes into a Swift module is not worth the effort. This repository setup was thrown together to separate the sample app from the library code; **I recommend to simply copy the relevant source code files into your project directly.**\n\n## Example\n\nSee the sample app for a simple \"breathing\" animation.\n\n```swift\nfunc setupAnimation() -\u003e ValueAnimationLoop {\n    // Configure the animation to \n    // - start with an animation from 0...100 in 3 seconds,\n    // - then loop back from 100...0 in 2 seconds.\n    let loop = ValueAnimationLoop(\n        value: 100,\n        increaseDuration: 3.0,\n        increaseCurve: .easeInOut,\n        decreaseDuration: 2.0,\n        decreaseCurve: .easeInOut,\n        startWith: .increment)\n    loop.progressHandler = { [weak self] in self?.animateValueChange($0) }\n    return loop \n}\n\nfunc animateValueChange(_ value: CGFloat) {\n    // Change a view's position, size, color, whatever.\n    print(value)\n}\n```\n\n## Code License\n\nCopyright (c) 2018 Christian Tietze. Distributed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancocoa%2Floopinganimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleancocoa%2Floopinganimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancocoa%2Floopinganimation/lists"}