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

v3.2.0

Compare
Choose a tag to compare
@jverkoey jverkoey released this 30 Aug 17:01
· 82 commits to stable since this release

This minor release introduces new features for presentation, view snapshotting, and defered transition work. There is also a new photo album example demonstrating how to build a contextual transition in which the context may change.

New features

Transition context now has a deferToCompletion: API for deferring work to the completion of the transition.

// Example (Swift):
foreImageView.isHidden = true
context.defer {
  foreImageView.isHidden = false
}

MDMTransitionPresentationController is a presentation controller that supports presenting view controllers at custom frames and showing an overlay scrim view.

The new MDMTransitionViewSnapshotter class can be used to create and manage snapshot views during a transition.

let snapshotter = TransitionViewSnapshotter(containerView: context.containerView)
context.defer {
  snapshotter.removeAllSnapshots()
}

let snapshotView = snapshotter.snapshot(of: view, isAppearing: context.direction == .forward)

Source changes

API changes

MDMTransitionContext

new method: deferToCompletion:. Defers execution of the provided work until the completion of the transition.

MDMTransitionPresentationController

new class: MDMTransitionPresentationController. A transition presentation controller implementation that supports animation delegation, a darkened overlay view, and custom presentation frames.

MDMTransitionViewSnapshotter

new class: MDMTransitionViewSnapshotter. A view snapshotter creates visual replicas of views so that they may be animated during a transition without adversely affecting the original view hierarchy.

Non-source changes