Add foreAlignmentEdge property to TransitionController.
ClosedPublic

Authored by featherless on Tue, Apr 18, 1:45 PM.

Details

Summary

If a view controller has a non-zero preferredContentSize, then the foreAlignmentEdge will be used to align the view to either the center of the screen, if nil, or to the specified edge (one of minX, minY, maxX, or maxY).

If preferredContentSize is zero, then the transition's finalFrame value will be used instead - this is generally the containerView's bounds.

This API is useful for building modal dialogs and sliding drawers that are presented over the current context with modalPresentationStyle = .overCurrentContext.

Diff Detail

Repository
rREACTIVEMOTIONSWIFT reactive-motion-swift
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
featherless created this revision.Tue, Apr 18, 1:45 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptTue, Apr 18, 1:45 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O4: Material Apple platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
markwei accepted this revision.Wed, Apr 19, 4:34 PM
markwei added a subscriber: markwei.
markwei added inline comments.
src/transitions/TransitionContext.swift
152

how come zero() is not treated the same as nil?

Also, diff summary should be modified to explain what happens when preferredContentSize is zero

This revision is now accepted and ready to land.Wed, Apr 19, 4:34 PM
featherless edited the summary of this revision. (Show Details)Thu, Apr 20, 12:38 PM
featherless marked an inline comment as done.
featherless added inline comments.
src/transitions/TransitionContext.swift
152

We fall back to using finalFrame when preferredContentSize is zero - this is the default behavior of a view controller transition.

This revision was automatically updated to reflect the committed changes.
featherless marked an inline comment as done.