Giter Club home page Giter Club logo

Comments (2)

jverkoey avatar jverkoey commented on September 23, 2024

🎊 My diff is ready for review at http://codereview.cc/D1259

from transitions-objc.

jverkoey avatar jverkoey commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.