{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/694","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/694/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/694/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/694/events","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/694","id":108994720,"number":694,"title":"[WIP] Support for supplementary views in ASCollectionView","user":{"login":"levi","id":8493,"avatar_url":"https://avatars.githubusercontent.com/u/8493?v=3","gravatar_id":"","url":"https://api.github.com/users/levi","html_url":"https://github.com/levi","followers_url":"https://api.github.com/users/levi/followers","following_url":"https://api.github.com/users/levi/following{/other_user}","gists_url":"https://api.github.com/users/levi/gists{/gist_id}","starred_url":"https://api.github.com/users/levi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levi/subscriptions","organizations_url":"https://api.github.com/users/levi/orgs","repos_url":"https://api.github.com/users/levi/repos","events_url":"https://api.github.com/users/levi/events{/privacy}","received_events_url":"https://api.github.com/users/levi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/CLA%20Signed","name":"CLA Signed","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-30T01:19:42Z","updated_at":"2015-10-01T01:15:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/694","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/694","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/694.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/694.patch"},"body":"A bit far from being runnable within an example project, but I wanted to put up what I had as of now to get the ball rolling on feedback. I saw a bunch of new patches showing up that impact ASDataController and I definitely didn't want to miss the party!\r\n\r\nMight be best to read through #691 before skimming through this code, as I briefly outlined the direction I'm embarking on in that issue.\r\n\r\nWhat remains to get to get this to a point where can be landed:\r\n- [ ] Finish up abstracting some of the internal insert/update/delete behavior in `ASDataController` to be exposed in such a way that a subclass like `ASCollectionDataController` can insert its supplementary view measure/layout passes.\r\n- [ ] Investigate ways in which I can use `invalidateLayout` events to resize the supplementary views without competing with the existing implementation of `reloadData` and `layoutSubviews`. UICollectionView actually invokes `invalidateLayout` on account of these events, so it would be much better if we moved toward using layout invalidation exclusively for ASCollectionView data controller updates.\r\n- [ ] Get this running in a sample project and battle test the various issues that arise\r\n- [ ] Write a bunch of unit tests\r\n\r\nWould love feedback on this. I don't have much time during the week, but have been making this a priority nights/weekends so we can have this ready for 2.0 in November."},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/144588926","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/694#issuecomment-144588926","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/694","id":144588926,"user":{"login":"levi","id":8493,"avatar_url":"https://avatars.githubusercontent.com/u/8493?v=3","gravatar_id":"","url":"https://api.github.com/users/levi","html_url":"https://github.com/levi","followers_url":"https://api.github.com/users/levi/followers","following_url":"https://api.github.com/users/levi/following{/other_user}","gists_url":"https://api.github.com/users/levi/gists{/gist_id}","starred_url":"https://api.github.com/users/levi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levi/subscriptions","organizations_url":"https://api.github.com/users/levi/orgs","repos_url":"https://api.github.com/users/levi/repos","events_url":"https://api.github.com/users/levi/events{/privacy}","received_events_url":"https://api.github.com/users/levi/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T01:15:10Z","updated_at":"2015-10-01T01:15:10Z","body":"Yo guys, my goal is to build this extensible enough that it could be customized for a custom collection view layout. I'm only building concrete support for flow layouts right now, but this can be changed by implementing a custom implementation of `ASCollectionViewLayoutInspecting` and setting it on the `ASCollectionView#layoutDelegate` property. The idea here is the inspector object gives insight to the data controller about the internal implementation of the layout so it can generate nodes correctly. If you check out `ASCollectionViewFlowLayoutInspector`, you can see the general heuristic implementation of an inspector for flow layouts. This is a good place to start for this patch."}}