Closed levi closed 8 years ago
Yes, presumably ASTableView and ASCollectionView cells can also provide a bridging point - honestly even a node that has a view directly added to the hierarchy should be able to do this, although only after the view is created.
@garrettmoon, @rcancro we should aim to do this if possible / useful. I know we have an internal copy of trait collection for iOS 7 support, so maybe we could use a protocol or a couple nasty typecasts if the methods we need to call on UITraitCollection are in fact named the same thing on CBLTraitCollection.
The community is planning an exciting long term road map for the project and getting organized around how to deliver these feature requests. We are moving to a new issue tracker with more sophisticated planning capabilities (check out www.realArtists.com and their new product: Ship!).
If you are interested in helping contribute to this component or any other, don’t hesitate to send me an email at AsyncDisplayKit@gmail.com. If you would like to contribute for a few weeks, I can also add you to our Ship bug tracker so that you can see what everyone is working on and actively coordinate with us.
As always, keep filing issues and submitting pull requests here on Github and we will only move things to the new tracker if they require long term coordination.
Knowing a view's size class is key in building adaptive layouts in iOS 8 & 9. This is exposed as
traitCollection
on any UIKit class that conforms toUITraitEnvironment
(UIView, UIViewController, UIScreen, etc.) While this is accessible on an ASDisplayNode'sview
, it is not accessible until the view has loaded, making it difficult to build layouts off main that depend on different size classes and trait environments.ASDisplayNode should be updated to allow external clients to set an internal
UITraitCollection
property. For example, a view controller implementing a subnode can set the node'straitCollection
property with the environment's current trait collection and update it when it changes. The node then has the opportunity to layout according to the trait collection and re-relayout when the trait collection changes.Now that we have
ASViewController
, this implementation could be even more seamless, with the view controller automatically sending trait collection updates to the base node as things update in UIKit.