material-motion-archive / transitions-objc Goto Github PK
View Code? Open in Web Editor NEWArchived February 16, 2017 :: Transitions for Apple Devices
License: Apache License 2.0
Archived February 16, 2017 :: Transitions for Apple Devices
License: Apache License 2.0
replicaControllerDelegate
API. Setting this property should assign the delegate to the director's private replicaController
instance.This is a private API and does not have a spec in the starmap because it is UIKit-specific.
Should lazily create an MDMTransitionController instance and assign it to the transitioningDelegate
The controller holds onto a reference of the transition but never releases it. It should release the transition instance when the transition completes.
The transition should provide a delegate that the controller can assign itself to in order to receive a "didFinish" event. The controller should nil out the transition instance when this event is received.
- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
presentingController:(UIViewController *)presenting
sourceController:(UIViewController *)source;
Must return an instance that conforms to UIViewControllerAnimatedTransitioning
. This instance should be a separate bridging object that creates the scheduler and director instances and coordinates their overall execution.
- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed;
Similar to the above, but requires a bit of shenanigans to infer the sourceViewController
.
- (id<UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id<UIViewControllerAnimatedTransitioning>)animator;
If we're driving this transition, the interaction controller is always the animator instance we returned in the first method.
- (id<UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id<UIViewControllerAnimatedTransitioning>)animator;
If we're driving this transition, the interaction controller is always the animator instance we returned in the first method.
We currently always treat every transition as an interactive transition. This is somewhat against the intended use of UIKit's transitioning APIs.
What we should be doing is acting as an interactive transition if there is some indication that the transition is, in fact, interactive. One signal we can use to start is whether any gesture recognizers associated with the transition are active.
Until we start working on interactive transitions support (Milestone 2) we may want to consider simplifying the transition controller logic to only implement the animated API variants.
As specific diffs:
MDMReplicaController
class with barebones documentation.MDMReplicaControllerDelegate
protocol and corresponding delegate
property on MDMReplicaController
.createReplica
API.disableReplicationForElement
API.Will enable support for customizing transitions using a transitionController.
Add a dependency to the runtime-objc repo's cocoapods file: https://github.com/material-motion/material-motion-runtime-objc
May be helpful to publish our own specs repo for development purposes.
This can be landed in multiple diffs:
MDMTransitionDirector
interface with documentation.This transition should be a simple TransitionDirector
instance.
Only one plan should be registered: the right view controller "shifting up" during presentation.
MDMSlideTransitionDirector
class.This transition should support any direction of sliding when being presented.
They are not, currently. This means the transition controller has no way of knowing when the transition has completed. As a result, the activeTransition object is held for much longer than it needs to be.
This breaks the overCurrentContext
modal presentation style. Specifically, when we dismiss such a view controller we're left with a black screen.
This controller publicly conforms to UIViewControllerTransitioningDelegate
.
Example use:
viewController.mdm_transitionController.directorClass = [PhotoDirector class];
Class prototype:
MDMTransitionController : NSObject <UIViewControllerTransitioningDelegate>
When mdm_transitionController
is accessed, an instance of MDMTransitionController should lazily be created and then assigned to the view controller's transitioningDelegate
(if one is not already set). This will allow us to hook in to the iOS view controller transitioning APIs.
Might be able to make use of CF_SWIFT_NAME:
Goal is to be able to do TransitionWindowSegment.entire
, TransitionWindowSegment.firstHalf
, etc... as per the spec.
Should be capable of registering gesture recognizers that initiate an action when the gesture recognizer starts.
Example API signature:
typedef NS_ENUM(NSUInteger, MDMTransitionAction) {
MDMTransitionActionPush,
MDMTransitionActionPop,
MDMTransitionActionPresent,
MDMTransitionActionDismiss
};
- (void)whenGestureRecognizerBegins:(nonnull UIGestureRecognizer *)gestureRecognizer
performAction:(MDMTransitionAction)action;
When the gesture recognizer begins the action should be taken, initiating the creation of the relevant Director.
Also make willPresentForeViewController an instance method that is called before setUp.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.