{"id":2333,"url":"https://github.com/DavdRoman/Popsicle","last_synced_at":"2025-08-02T23:33:10.475Z","repository":{"id":56907822,"uuid":"12901586","full_name":"davdroman/Popsicle","owner":"davdroman","description":"Simple, extensible interpolation framework","archived":true,"fork":false,"pushed_at":"2022-11-22T20:11:22.000Z","size":1849,"stargazers_count":1088,"open_issues_count":3,"forks_count":105,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-12-04T21:25:37.926Z","etag":null,"topics":[],"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/davdroman.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":"2013-09-17T17:09:34.000Z","updated_at":"2024-10-25T16:14:11.000Z","dependencies_parsed_at":"2022-08-21T03:21:01.685Z","dependency_job_id":null,"html_url":"https://github.com/davdroman/Popsicle","commit_stats":null,"previous_names":["dromaguirre/drdynamicslideshow"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davdroman%2FPopsicle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davdroman%2FPopsicle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davdroman%2FPopsicle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davdroman%2FPopsicle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davdroman","download_url":"https://codeload.github.com/davdroman/Popsicle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503191,"owners_count":17930532,"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-01-05T20:16:11.117Z","updated_at":"2024-12-06T17:31:00.929Z","avatar_url":"https://github.com/davdroman.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Animation"],"sub_categories":["Animation","Other free courses","Utility"],"readme":"\u003e **THIS PROJECT IS NO LONGER MAINTAINED.**\n\n---\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"Assets/header.png\" alt=\"Popsicle header\" width=\"520px\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg\" alt=\"Carthage compatible\" /\u003e\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org/pods/Popsicle\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/Popsicle.svg\" alt=\"CocoaPods compatible\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"Assets/1.gif\" alt=\"GIF 1\" width=\"320px\" /\u003e\n\u003c/p\u003e\n\nPopsicle is a Swift framework for creating and managing interpolations of different value types with built-in UIKit support.\n\n## Installation\n\n#### Carthage\n\n```\ngithub \"DavdRoman/Popsicle\"\n```\n\n#### CocoaPods\n\n```ruby\npod 'Popsicle'\n```\n\n#### Manual\n\nDrag and copy all files in the [__Popsicle__](Popsicle) folder into your project.\n\n## At a glance\n\n#### Interpolating UIView (or any other NSObject) values\n\nFirst, you need an `Interpolator` instance:\n\n```swift\nlet interpolator = Interpolator()\n```\n\nNext, you need to add some `Interpolation\u003cT\u003e` instances to your interpolator. In the example below, we are going to interpolate the alpha value of a UIView for times between 0 and 150:\n\n```swift\nlet interpolation = Interpolation(yourView, alpha)\ninterpolation[0] = 0\ninterpolation[150] = 1\nself.interpolator.addInterpolation(interpolation)\n```\n\nNote `alpha` is a built-in `KeyPath\u003cT, U\u003e` constant. Popsicle offers a nice set of [__UIKit-related KeyPaths__](Popsicle/KeyPath.swift) ready to be used. You may also use a completely custom key path.\n\nYou can also modify the easing function used at a given time:\n\n```swift\ninterpolation.setEasingFunction(EasingFunctionEaseOutQuad, forTime: 0)\n```\n\nThere's a bunch of [__built-in easing functions__](Popsicle/EasingFunction.swift) to choose from.\n\nFinally, just make your `interpolator` vary its `time` depending on whatever you want. For example, the content offset of a `UITableView`:\n\n```swift\nfunc scrollViewDidScroll(scrollView: UIScrollView) {\n\tinterpolator.time = Double(scrollView.contentOffset.y)\n}\n```\n\n#### Interpolating custom values\n\nYou can declare a value type as interpolable by making it conform to the `Interpolable` protocol.\n\nAs an example, check out how `CGPoint` conforms to `Interpolable`:\n\n```swift\nextension CGSize: Interpolable {\n\tpublic static func interpolate(from fromValue: CGSize, to toValue: CGSize, withProgress progress: Progress) -\u003e CGSize {\n\t\tlet width = CGFloat.interpolate(from: fromValue.width, to: toValue.width, withProgress: progress)\n\t\tlet height = CGFloat.interpolate(from: fromValue.height, to: toValue.height, withProgress: progress)\n\n\t\treturn CGSizeMake(width, height)\n\t}\n\n\tpublic static func objectify(value: CGSize) -\u003e AnyObject {\n\t\treturn NSValue(CGSize: value)\n\t}\n}\n```\n\n## License\n\nPopsicle is available under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavdRoman%2FPopsicle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavdRoman%2FPopsicle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavdRoman%2FPopsicle/lists"}