{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/879","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/879/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/879/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/879/events","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/879","id":118485565,"number":879,"title":"Add custom collection view layout example project","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"},{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/documentation","name":"documentation","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-23T22:15:59Z","updated_at":"2015-11-30T05:48:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/879","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/879","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/879.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/879.patch"},"body":"Wrote a simple Pinterest-style custom CollectionViewLayout and integrated it with ASCollectionView in a sample project to show how to use the layout inspector API. The layout supports supplementary header views, which receive a constrained size from the custom layout inspector.\r\n\r\nThis patch also introduces the ability for the layout inspector to define the constrained size of the collection view item. By default, ASCollectionView measures its item constrained size by some heuristics that make the assumption that all cells should be measured with flow layout behavior. From the perspective of UICollectionView, all items receive a constrained size from the UICollectionViewLayoutAttributes#frame property in the layout and this behavior can vary in a custom layout implementation the one in the sample project. \r\n\r\nTo increase the flexibility of the constrained size, the layout inspector is now consulted for the size of the item at the given index path. In the included example, the custom inspector queries the internals of the layout for the size. In the case of a regular flow layout, the default behavior of measuring based on the scroll direction still remains. In a future patch, I would like to move the logic of this behavior in the flow layout inspector (left a few TODOs in the source). However, the logic also generically supports defining an item size for non-flow layouts. I like this idea of having the support for custom non-supplementary view custom layouts without the need to implement extra APIs and I want to take a deeper look into retaining this behavior when cleaning up the delegation."},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/160523760","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/879#issuecomment-160523760","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/879","id":160523760,"user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T05:48:07Z","updated_at":"2015-11-30T05:48:07Z","body":"@levi one last thing! :-D\r\n\r\n/Users/travis/build/facebook/AsyncDisplayKit/AsyncDisplayKit/ASCollectionView.mm:673:15: error: no viable conversion from 'const CGSize' to 'ASSizeRange'\r\n  ASSizeRange constrainedSize = CGSizeZero;"}}