Skip to content
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

Merged
merged 3 commits into from
Jul 18, 2017

Conversation

nguyenhuy
Copy link
Member

  • 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();
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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;
Copy link
Member

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?

Copy link
Member Author

@nguyenhuy nguyenhuy Jul 17, 2017

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.

Copy link
Member

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();
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nguyenhuy
Copy link
Member Author

Thanks for the review, @garrettmoon!

@nguyenhuy nguyenhuy merged commit 78c133e into TextureGroup:master Jul 18, 2017
@nguyenhuy nguyenhuy deleted the HNGalleryLayoutItemProvider branch July 18, 2017 10:15
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants