[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6875":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":15,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":34,"discoverSource":35},6875,"Advance","timdonnelly\u002FAdvance","timdonnelly","Physics-based animations for iOS, tvOS, and macOS.","http:\u002F\u002Ftimdonnelly.github.io\u002FAdvance\u002F",null,"Swift",4473,204,2,0,58.94,"BSD 2-Clause \"Simplified\" License",true,false,"master",[22,23,24,25,26,27,28,29,30],"animation","gestures","interaction","ios","motion","physics","springs","swift","ui","2026-06-12 04:00:30","[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Ftimdonnelly\u002FAdvance.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Ftimdonnelly\u002FAdvance)\n![Swift 5.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSwift-5.0-orange.svg)\n![GitHub release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Ftimdonnelly\u002FAdvance.svg)\n[![SwiftPM compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSwiftPM-compatible-orange.svg)](#swift-package-manager)\n[![CocoaPods compatible](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FAdvance.svg)](#cocoapods) \n\n\n\n# Advance\n\nAn animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respond realistically.\n\n\n```swift\nlet view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\n\n\u002F\u002F Springs animate changes to a value\nlet spring = Spring(initialValue: view.center)\n\n\u002F\u002F The `onChange` closure will be called every time the spring updates\nspring.onChange = { [view] newCenter in\n    view.center = newCenter\n}\n\n\u002F\u002F\u002F The view's center will realistically animate to the new target value.\nspring.target = CGPoint(x: 300, y: 200)\n```\n\n## Installation\n\nThere are several ways to integrate Advance into your project.\n\n* **Manually:** add  `Advance.xcodeproj` to your project, then add `Advance-{iOS|macOS|tvOS}.framework` as an \"Embedded Binary\" to your application target (under General in target settings). From there, add `import Advance` to your code and you're good to go.\n\n* **Carthage:** add `github \"timdonnelly\u002FAdvance\"` to your `Cartfile`.\n\n* **CocoaPods:** add `pod 'Advance'` to your `Podfile`.\n\n* **Swift Package Manager:** add a dependency to your `Project.swift`: `.package(url: \"http:\u002F\u002Fgithub.com\u002Ftimdonnelly\u002FAdvance\", from: \"3.0.0\")`\n\n##### Requirements\n* iOS 10+, tvOS 10+, or macOS 10.12+\n* Swift 5.0 (Xcode 10.2 or higher)\n\n## Usage\n\n**API documentation is [available here](http:\u002F\u002Ftimdonnelly.github.io\u002FAdvance\u002F).**\n\nAdvance animations are applied on every frame (using `CADisplayLink` on iOS\u002FtvOS, and `CVDisplayLink` on macOS), allowing for fine-grained control at any time.\n\n\n### `Spring`\n\n`Spring` instances animate changes to a value over time, using spring physics.\n\n\n```swift\nlet spring = Spring(initialValue: 0.0)\nspring.onChange = { [view] newAlpha in \n    view.alpha = newAlpha \n}\n\n\u002F\u002F Off it goes!\nspring.target = 0.5\n```\n\n#### Configuring a spring\n\n```swift\n\n\u002F\u002F\u002F Spring values can be adjusted at any time.\nspring.tension = 30.0 \u002F\u002F\u002F The strength of the spring\nspring.damping = 2.0 \u002F\u002F\u002F The resistance (drag) that the spring encounters\nspring.threshold = 0.1 \u002F\u002F\u002F The maximum delta between the current value and the spring's target (for each component) for which the simulation can enter a converged state.\n\n\u002F\u002F\u002F Update the simulation state at any time.\nspring.velocity = 6.5\nspring.value = 0.2\n\n\u002F\u002F\u002F Sets the spring's target and the current simulation value, and removes all velocity. This causes the spring to converge at the given value.\nspring.reset(to: 0.5)\n\n```\n\n\n### `Animator`\n\n`Animator` allows for more flexibility in the types of animation that can be performed, but gives up some convenience\nin order to do so. Specifically, animators allow for *any* type of animation or simulation to be performed for a single\nvalue.\n\n```swift\nlet view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))\n\n\u002F\u002F\u002F Animators coordinate animations to drive changes to a value.\nlet sizeAnimator = Animator(initialValue: view.bounds.size)\n\nsizeAnimator.onChange = { [view] newSize in\n    view.bounds.size = newSize\n}\n\n\u002F\u002F\u002F A simple timed animation\nsizeAnimator.animate(to: CGSize(width: 123, height: 456), duration: 0.25, timingFunction: .easeInOut)\n\n\u002F\u002F\u002F Some time in the future (before the previous timed animation was complete)...\n\n\u002F\u002F\u002F Spring physics will move the view's size to the new value, maintaining the velocity from the timed animation.\nsizeAnimator.simulate(using: SpringFunction(target: CGSize(width: 300, height: 300)))\n\n\u002F\u002F\u002F Some time in the future (before the previous spring animation was complete)...\n\n\u002F\u002F\u002F The value will keep the same velocity that it had from the preceeding spring\n\u002F\u002F\u002F animation, and a decay function will slowly bring movement to a stop.\nsizeAnimator.simulate(using: DecayFunction(drag: 2.0))\n\n```\n\nAnimators support two fundamentally different types of animations: timed and simulated.\n\n#### Timed animations\n\nTimed animations are, well, timed: they have a fixed duration, and they animate to a final value in a predictable manner.\n\n```swift\nanimator.animate(to: CGSize(width: 123, height: 456), duration: 0.25, timingFunction: .easeInOut)\n```\n\n`TimingFunction` described the pacing of a timed animation. \n\n`TimingFunction` comes with a standard set of functions:\n\n```swift\nTimingFunction.linear \u002F\u002F No easing\nTimingFunction.easeIn\nTimingFunction.easeOut\nTimingFunction.easeInOut\nTimingFunction.swiftOut \u002F\u002F Similar to Material Design's default curve\n```\n\nCustom timing functions can be expressed as unit beziers ([described here](https:\u002F\u002Fwww.w3.org\u002FTR\u002Fcss-easing-1\u002F#cubic-bzier-timing-function)).\n\n```swift\nlet customTimingFunction = TimingFunction(x1: 0.1, y1: 0.2, x2: 0.6, y2: 0.0)\n```\n\n#### Simulated animations\n\nSimulated animations use a *simulation function* to power a physics-based transition. Simulation functions are types conforming to the `SimulationFunction` protocol.\n\nSimulated animations may be started using two different methods:\n\n```swift\n\u002F\u002F Begins animating with the custom simulation function, maintaining the previous velocity of the animator.\nanimator.simulate(using: MyCustomFunction())\n\n\u002F\u002F or...\n\n\u002F\u002F Begins animating with the custom simulation function, imparting the specified velocity into the simulation.\nanimator.simulate(using: DecayFunction(), initialVelocity: dragGestureRecognizer.velocity(in: view))\n```\n\n### Animating Custom Types\n\nValues conforming to the `VectorConvertible` protocol can be animated by Advance. Conforming types can be converted to and from a `Vector` implementation.\n```swift\npublic protocol VectorConvertible: Equatable, Interpolatable {\n    associatedtype VectorType: SIMD where VectorType.Scalar == Double\n    init(vector: VectorType)\n    var vector: VectorType { get }\n}\n```\n\nThe library adds conformance for many common types through extensions.\n\n\n## Contributing\n\nIf you encounter any issues or surprises, please open an issue.\n\nFor suggestions or new features, please consider opening a PR with a functional implementation. Issues may be used if you aren't sure how to implement the change, but working code is typically easier to evaluate.\n\n## License\nThis project is released under the [BSD 2-clause license](https:\u002F\u002Fgithub.com\u002Ftimdonnelly\u002FAdvance\u002Fblob\u002Fmaster\u002FLICENSE).\n","Advance 是一个用于 iOS、tvOS 和 macOS 的基于物理特性的动画库。它利用弹簧等物理模型来实现自然流畅的动画效果，使用户界面元素能够以更真实的方式移动和响应。项目支持 Swift 5.0，并且可以通过多种方式（如手动、Carthage、CocoaPods 或 Swift Package Manager）集成到项目中。Advance 适合需要高质量动态交互体验的应用场景，例如游戏、多媒体应用或任何追求生动视觉反馈的软件产品。其核心功能包括对值变化进行弹簧动画处理，开发者可通过调整弹簧参数如张力、阻尼等来控制动画行为，从而实现高度定制化的动画效果。","2026-06-11 03:09:20","top_language"]