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

Add support for multiple transitions per view controller transition #40

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

jverkoey
Copy link
Contributor

@jverkoey jverkoey commented Aug 30, 2017

Closes #31.

This is a breaking change due to removal of APIs and changing of nullability annotations on existing APIs.

This PR allows a client to associate multiple Transition instances with a single view controller transition. When a transition is initiated, each Transition instance will be provided the same transition context.

This allows us to build smaller transition types, such as "FadeTransition" or "SlideTransition" which each accept a target view. These transitions can then be combined to create a "slide and fade in transition" like so:

modalViewController.transitionController.transitions = [
  FadeTransition(target: .foreView),
  SlideUpTransition(target: .foreView)
]

Some open questions this change has introduced:

  • How does view duplication work across transitions? Ideally if a view were duplicated by one transition it would not be re-duplicated by another, but ensuring that all transitions access views in a safe manner would require adoption of a convention, e.g. context.resolvedView(for: view), which would be routed through a shared view duplicator.
  • Who is responsible for associating transitions with a given view controller transition? There are potentially three actors who might be interested in associating Interaction instances. This topic is discussed in Add support for on-demand transitions #39.
  • How might a client easily build a transition that is composed of other transitions? This may warrant a follow-up feature change, possibly with the introduction of a TransitionWithChildTransitions protocol that allows the parent transition to return an array of child transitions.

@jverkoey jverkoey force-pushed the multitransition branch 4 times, most recently from b24cd0e to 9f7e373 Compare September 6, 2017 14:53
@jverkoey jverkoey changed the title WIP of support for multiple transitions per view controller transition Add support for multiple transitions per view controller transition Sep 6, 2017
ajsecord
ajsecord previously approved these changes Sep 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for decorating transitions
2 participants