Comments (2)
🎊 My diff is ready for review at http://codereview.cc/D1259
from transitions-objc.
From the discussion at http://codereview.cc/D1259:
Why'd we need to use associated objects?
Primarily because transitioningDelegate is a weak property. Because of this, somebody needs to hold a strong reference to the instance. There are many answers to "who should own this object?" and we've chosen one that appeared to balance convenience with expressivity.
Background
We want our transitionController to customize both the present and dismiss transitions. Using an associated object is a convenient way to ensure that our controller lives at least as long as the controller whose transitions it is customizing.
Some other ways that we'd considered building this API:
- Having a global transition coordinator singleton that has a lookup table of VC1/VC2 => Director. This has the advantage of allowing transitions to be customized without diving in to view controller code. It has the disadvantage of making the call-site code of present/dismiss less clear as to which director will govern the transition. Note: we can still support this approach even with this associated object API.
- Making the calling view controller store the transitionController instance. This introduces some overhead into every calling controller in that they must now store a transitionController instance any time they want to present a view controller.
from transitions-objc.
Related Issues (20)
- Cut the v1 release HOT 1
- Migrate APIs to new protocol-based design HOT 2
- Create Transition object HOT 1
- Remove MDMViewControllerTransition and consolidate logic into MDMTransitionController HOT 1
- Rename directorClass to directorType HOT 2
- Implement TimeWindow APIs HOT 1
- Provide a UINavigationControllerDelegate implementation
- Implement TransitionWindow API HOT 1
- Update FadeIn transition director example using TransitionTween HOT 1
- Implement TransitionTween HOT 2
- Prototype a connection of the transition's timeline with arbitrary gesture recognizers
- Transitions must set their internal delegate HOT 1
- Default transition duration should be 0.35s to match system default HOT 1
- Introduce TransitionDirection type HOT 1
- Expose containerView API on Transition HOT 1
- Prototype Photos transition interaction
- Expose stock TransitionWindowSegment values as struct properties in swift
- Pass transition object to director's setUp method
- Rename setUp to willBeginTransition HOT 1
- Don't modify the destination view controller's superview if it already exists HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transitions-objc.