-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ASCollectionLayout] Add ASCollectionGalleryLayoutSizeProviding #451
[ASCollectionLayout] Add ASCollectionGalleryLayoutSizeProviding #451
Conversation
nguyenhuy
commented
Jul 17, 2017
- This allows users to return different sizes based on certain conditions, such as the collection node's bounds or grid constants.
- ASPagerNode will also act as a size provider to ensure all pages have an up-to-date size that is its bounds.
- This allows users to return different sizes based on certain conditions, such as the collection node's bounds or grid constants. - ASPagerNode will also act as a size provider to ensure all pages have an up-to-date size that is its bounds.
@@ -36,11 +36,13 @@ - (instancetype)initWithNumberOfColumns:(NSInteger)numberOfColumns headerHeight: | |||
|
|||
- (ASScrollDirection)scrollableDirections | |||
{ | |||
ASDisplayNodeAssertMainThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these and the below necessary? Seems a little strange to be in 'client' code? Leftover from testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally added to tell whoever reading this example that these methods are called on main. Some rarely read the documentation :) I can definitely remove it if you think it's excessive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point!
@@ -23,7 +40,9 @@ NS_ASSUME_NONNULL_BEGIN | |||
AS_SUBCLASSING_RESTRICTED | |||
@interface ASCollectionGalleryLayoutDelegate : NSObject <ASCollectionLayoutDelegate> | |||
|
|||
- (instancetype)initWithScrollableDirections:(ASScrollDirection)scrollableDirections itemSize:(CGSize)itemSize NS_DESIGNATED_INITIALIZER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this one need to be deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was merged last week (#76) and is still in Beta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -36,11 +36,13 @@ - (instancetype)initWithNumberOfColumns:(NSInteger)numberOfColumns headerHeight: | |||
|
|||
- (ASScrollDirection)scrollableDirections | |||
{ | |||
ASDisplayNodeAssertMainThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point!
@@ -23,7 +40,9 @@ NS_ASSUME_NONNULL_BEGIN | |||
AS_SUBCLASSING_RESTRICTED | |||
@interface ASCollectionGalleryLayoutDelegate : NSObject <ASCollectionLayoutDelegate> | |||
|
|||
- (instancetype)initWithScrollableDirections:(ASScrollDirection)scrollableDirections itemSize:(CGSize)itemSize NS_DESIGNATED_INITIALIZER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks for the review, @garrettmoon! |
…ureGroup#451) * Add ASCollectionGalleryLayoutSizeProviding - This allows users to return different sizes based on certain conditions, such as the collection node's bounds or grid constants. - ASPagerNode will also act as a size provider to ensure all pages have an up-to-date size that is its bounds. * Update CHANGELOG * ASPagerNode to use gallery layout delegate if told to