[Gallery layout] Include the caller in properties providing methods (#533)

* Include the caller in ASCollectionGalleryLayoutPropertiesProviding's methods

* Update CHANGELOG.md
This commit is contained in:
Huy Nguyen
2017-09-08 17:05:06 +01:00
committed by GitHub
parent 53e99cc762
commit d4b1f625aa
5 changed files with 23 additions and 13 deletions

View File

@@ -14,6 +14,7 @@
#import <AsyncDisplayKit/ASScrollDirection.h>
@class ASElementMap;
@class ASCollectionGalleryLayoutDelegate;
NS_ASSUME_NONNULL_BEGIN
@@ -24,11 +25,13 @@ NS_ASSUME_NONNULL_BEGIN
*
* @discussion This method will only be called on main thread.
*
* @param delegate The calling object.
*
* @param elements All elements to be sized.
*
* @return The elements' size
*/
- (CGSize)sizeForElements:(ASElementMap *)elements;
- (CGSize)galleryLayoutDelegate:(ASCollectionGalleryLayoutDelegate *)delegate sizeForElements:(ASElementMap *)elements;
@optional
@@ -42,11 +45,13 @@ NS_ASSUME_NONNULL_BEGIN
* It is not applied between the first line and the header, or between the last line and the footer.
* This is the same behavior as UICollectionViewFlowLayout's minimumLineSpacing.
*
* @param delegate The calling object.
*
* @param elements All elements in the layout.
*
* @return The interitem spacing
*/
- (CGFloat)minimumLineSpacingForElements:(ASElementMap *)elements;
- (CGFloat)galleryLayoutDelegate:(ASCollectionGalleryLayoutDelegate *)delegate minimumLineSpacingForElements:(ASElementMap *)elements;
/**
* Returns the minumum spacing to use between items in the same row or column, depending on the scroll directions.
@@ -58,22 +63,26 @@ NS_ASSUME_NONNULL_BEGIN
* It is considered while fitting items into lines, but the actual final spacing between some items might be larger.
* This is the same behavior as UICollectionViewFlowLayout's minimumInteritemSpacing.
*
* @param delegate The calling object.
*
* @param elements All elements in the layout.
*
* @return The interitem spacing
*/
- (CGFloat)minimumInteritemSpacingForElements:(ASElementMap *)elements;
- (CGFloat)galleryLayoutDelegate:(ASCollectionGalleryLayoutDelegate *)delegate minimumInteritemSpacingForElements:(ASElementMap *)elements;
/**
* Returns the margins of each section.
*
* @discussion This method will only be called on main thread.
*
* @param delegate The calling object.
*
* @param elements All elements in the layout.
*
* @return The margins used to layout content in a section
*/
- (UIEdgeInsets)sectionInsetForElements:(ASElementMap *)elements;
- (UIEdgeInsets)galleryLayoutDelegate:(ASCollectionGalleryLayoutDelegate *)delegate sectionInsetForElements:(ASElementMap *)elements;
@end