v1.1.0
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 ofinit(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
- Store interactions before adding them so that order is maintained when interactions add other interactions. (Jeff Verkoeyen)
- Avoid over-completion of chained property animations. (Jeff Verkoeyen)
- Fix bug causing properties-chained-to-properties to not animate correctly. (Jeff Verkoeyen)
- Add SlopRegion interaction. (Jeff Verkoeyen)
- Add topEdgeDismisserDelegate API to ViewControllerDismisser. (Jeff Verkoeyen)
- Add Gesturable convenience initializer for extracting the first gesture recognizer from a sequence of gesture recognizers. (Jeff Verkoeyen)
- Rename ChangeDirectionOnRelease(of:) to ChangeDirection(withVelocityOf:) (Jeff Verkoeyen)
- Fix crashing bug when connecting properties to one another. (Jeff Verkoeyen)
- Add ChangeDirectionOnRelease interaction. (Jeff Verkoeyen)
- Make TransitionSpring and Spring T type conform to Subtractable so that coreAnimation can be set as the default system. (Jeff Verkoeyen)
- TransitionSpring configuration now defaults to Core Animation configuration defaults. (Jeff Verkoeyen)
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
- Modify the PushBackTransition example to use connected properties instead of multiple springs. (Jeff Verkoeyen)
- Simplify the interactive push back transition example. (Jeff Verkoeyen)
- Add syntax highlighting languages to the README. (Jeff Verkoeyen)
- Add example Podfile to the README. (Jeff Verkoeyen)