Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

v1.1.0

Compare
Choose a tag to compare
@jverkoey jverkoey released this 29 Mar 20:23
· 106 commits to stable since this release

This is our first minor release. It includes two new interactions and improvements to APIs for the common cases.

Behavioral changes

  • TransitionSpring's configuration now defaults to Core Animation's default values. If you prefer to continue using the original Spring defaults you can use the following snippet:
spring.tension.value = defaultSpringTension
spring.friction.value = defaultSpringFriction
spring.mass.value = defaultSpringMass
spring.suggestedDuration.value = 0

New deprecations

  • Tossable's init(system:draggable:) is deprecated in favor of init(spring:draggable:).

New features

New interactions: ChangeDirection and SlopRegion.

Gesturable interactions can now be initialized with a sequence of gesture recognizers. This makes it easier to create gesturable interactions in transitions where the gesture recognizers are provided as a set.

Spring's system now defaults to Core Animation.

There is a new API for getting a gesture recognizer delegate that's able to coordinate a "drag to dismiss" transition with a vertical scroll view.

let pan = UIPanGestureRecognizer()
pan.delegate = transitionController.dismisser.topEdgeDismisserDelegate(for: scrollView)

Source changes

API changes

Auto-generated by running:

apidiff origin/stable release-candidate swift MaterialMotion.xcworkspace MaterialMotion

New global constants

new global var: defaultTransitionSpringFriction

new global var: defaultTransitionSpringSuggestedDuration

new global var: defaultTransitionSpringTension

new global var: defaultTransitionSpringMass

New interactions

new class: ChangeDirection

new class: SlopRegion

Modified interactions

Gesturable

Affects Draggable, Rotatable, and Scalable.

new method: init(withFirstGestureIn:) in Gesturable

Spring

Type of change: Declaration
From: public class Spring<T> : Interaction, Togglable, Stateful where T : Zeroable
To: public class Spring<T> : Interaction, Togglable, Stateful where T : Subtractable, T : Zeroable

modified method: init(threshold:system:) in Spring

Type of change: Declaration
From: public init(threshold: CGFloat, system: @escaping SpringToStream<T>)
To: public init(threshold: CGFloat = 1, system: @escaping SpringToStream<T> = coreAnimation)

Tossable

modified method: init(spring:draggable:) in Tossable

Type of change: Declaration
From: public init(spring: Spring<CGPoint>, draggable: Draggable = Draggable())
To: public init(spring: Spring<CGPoint> = Spring(), draggable: Draggable = Draggable())

deprecated method: init(system:draggable:) in Tossable. Use init(spring:draggable:) instead.

TransitionSpring

modified class: TransitionSpring

Type of change: Declaration
From: public final class TransitionSpring<T> : Spring<T> where T : Zeroable
To: public final class TransitionSpring<T> : Spring<T> where T : Subtractable, T : Zeroable

modified method: init(back:fore:direction:threshold:system:) in TransitionSpring

Type of change: Declaration
From: public init(back backwardDestination: T, fore forwardDestination: T, direction: ReactiveProperty<TransitionDirection>, threshold: CGFloat, system: @escaping SpringToStream<T>)
To: public init(back backwardDestination: T, fore forwardDestination: T, direction: ReactiveProperty<TransitionDirection>, threshold: CGFloat = default, system: @escaping SpringToStream<T> = default)

Transitions

ViewControllerDismisser

new method: topEdgeDismisserDelegate(for:) in ViewControllerDismisser

Stream changes

new var: onCompletion in CoreAnimationChannelAdd

removed var: onCompletion in CoreAnimationChannelAdd

Non-source changes