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

Add support for transitions with custom presented views. #55

Merged
merged 2 commits into from
Nov 13, 2017
Merged

Conversation

jverkoey
Copy link
Contributor

@jverkoey jverkoey commented Nov 10, 2017

If the transition's presentation controller implements -presentedView, it's possible that viewForKey: will not return the view of either of the fore/back view controllers. This type of behavior is often implemented if the presented view controller's view is being embedded inside of another view.

In order to support this behavior, we must use the viewForKey: API to fetch the desired view. If that view matches the view controller's view, then we can set the view's frame to the view controller's destination frame as we had been doing before. Otherwise, we make no modifications to the view's frame.

This feature will be used to implement the BottomSheet component using MotionTransitioning.

If the transition's presentation controller implements -presentedView, it's possible that viewForKey: will not return the view of either of the fore/back view controllers. This type of behavior is often implemented if the presented view controller's view is being embedded inside of another view.

In order to support this behavior, we must use the viewForKey: API to fetch the desired view. If that view matches the view controller's view, then we can set the view's frame to the view controller's destination frame as we had been doing before. Otherwise, we make no modifications to the view's frame.
@jverkoey
Copy link
Contributor Author

Gentle ping.

Copy link

@romoore romoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is there a test for this case that we could write without requiring the full view hierarchy?

@jverkoey
Copy link
Contributor Author

Will add tests in follow-up. #57

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.

2 participants