CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✓ |
| LangLanguage | SwiftSwift |
| License | Apache 2 |
| ReleasedLast Release | Feb 2017 |
| SwiftSwift Version | 3.0 |
| SPMSupports SPM | ✗ |
Maintained by Jeff Verkoeyen.
| Depends on: | |
| pop | ~> 1.0 |
| MaterialMotionRuntime | < 7.0, >= 4.0 |
The POP Material Motion family provides a bridge between Facebook’s POP library and the Material Motion runtime.
SpringTo uses POP springs to animate properties using spring physics driven on the main thread of the application.
For example, you might use a SpringTo plan to move a view’s position to a specific position on screen:
let springTo = SpringTo("position", destination: CGPoint(x: 10, y: 10))
scheduler.addPlan(springTo, to: view.layer)SpringTo supports a subset of key paths on certain types:
CALayer
backgroundColorboundscornerRadiusborderWidthborderColoropacitypositionposition.xposition.ytransform.rotation.ztransform.rotation.xtransform.rotation.ytransform.scale.xtransform.scaletransform.scale.ybounds.sizesublayerTransform.scalesublayerTransform.translation.xsublayerTransform.translationsublayerTransform.translation.ysublayerTransform.translation.ztransform.translation.xtransform.translationtransform.translation.ytransform.translation.zzPositionshadowColorshadowOffsetshadowOpacityshadowRadiusCAShapeLayer
strokeStartstrokeEndstrokeColorfillColorlineWidthlineDashPhaseNSLayoutConstraint
constantUIView
alphabackgroundColorboundscenterframetransform.scale.xtransform.scaletransform.scale.ybounds.sizetintColorUIScrollView
contentOffsetcontentSizezoomScalecontentInsetscrollIndicatorInsetsUINavigationBar
barTintColorUILabel
textColorRead the feature request for supporting more key paths.
Import the framework:
@import MaterialMotionPop;
You will now have access to all of the APIs.
Check out a local copy of the repo to access the Catalog application by running the following commands:
git clone https://github.com/material-motion/pop-swift.git
cd pop-swift
pod install
open MaterialMotionPop.xcworkspace
Code snippets:
In Objective-C:
MDMSpringTo *springTo = [[MDMSpringTo alloc] initWithProperty:"<#property key path#>"
destination:<#Destination value#>];
[scheduler addPlan:springTo to:<#Object#>];In Swift:
let springTo = SpringTo("<#property key path#>", destination: <#Destination value#>)
scheduler.addPlan(springTo, to: <#Object#>)A spring’s behavior can be configured by setting a SpringConfiguration object on the SpringTo instance.
Code snippets:
In Objective-C:
springTo.configuration = [[MDMSpringConfiguration alloc] initWithTension:<#tension#>
friction:<#friction#>];In Swift:
springTo.configuration = SpringConfiguration(tension: <#tension#>, friction: <#friction#>)Code snippets:
In Objective-C:
MDMPauseSpring *pauseSpring = [[MDMPauseSpring alloc] initWithProperty:"<#property key path#>"
gestureRecognizer:<#gesture recognizer#>];
[scheduler addPlan:springTo to:<#Object#>];In Swift:
let springTo = MDMPauseSpring("<#property key path#>", whileActive: <#gesture recognizer#>)
scheduler.addPlan(springTo, to: <#Object#>)We welcome contributions!
Check out our upcoming milestones.
Learn more about our team, our community, and our contributor essentials.
Licensed under the Apache 2.0 license. See LICENSE for details.