2017-02-11 01:58:52 +00:00
|
|
|
/**
|
2018-11-01 17:56:41 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-02-11 01:58:52 +00:00
|
|
|
*
|
2018-05-01 21:33:50 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-02-11 01:58:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
|
|
|
|
|
#import <IGListKit/IGListMacros.h>
|
2019-06-14 23:19:38 +00:00
|
|
|
#import <IGListKit/IGListExperiments.h>
|
2017-02-11 01:58:52 +00:00
|
|
|
|
2019-01-17 15:50:48 +00:00
|
|
|
#import "IGListCollectionViewLayoutCompatible.h"
|
|
|
|
|
|
2017-02-11 01:58:52 +00:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
/**
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
This UICollectionViewLayout subclass is for vertically or horizontally scrolling lists of data with variable widths and
|
|
|
|
|
heights. It supports an infinite number of sections and items. All work is done on the main thread, and while extremely efficient,
|
2017-02-11 01:58:52 +00:00
|
|
|
care must be taken not to stall the main thread in sizing delegate methods.
|
|
|
|
|
|
|
|
|
|
This layout piggybacks on the mechanics of UICollectionViewFlowLayout in that:
|
|
|
|
|
|
|
|
|
|
- Your UICollectionView data source must also conform to UICollectionViewDelegateFlowLayout
|
|
|
|
|
- Header support given via UICollectionElementKindSectionHeader
|
|
|
|
|
|
|
|
|
|
All UICollectionViewDelegateFlowLayout methods are required and used by this layout:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
|
|
|
|
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;
|
|
|
|
|
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
|
|
|
|
|
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
|
|
|
|
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
|
|
|
|
|
```
|
|
|
|
|
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
In a vertically scrolling layout, sections and items are put into the same horizontal row until the max-x position
|
|
|
|
|
of an item extends beyond the width of the collection view. When that happens, the item is "newlined" to the next row.
|
|
|
|
|
The y position of that row is determined by the maximum height (including section insets) of the section/item of the previous row.
|
2017-02-11 01:58:52 +00:00
|
|
|
|
|
|
|
|
Ex. of a section (2,0) with a large width causing a newline.
|
|
|
|
|
```
|
|
|
|
|
|[ 0,0 ][ 1,0 ] |
|
|
|
|
|
|[ 2,0 ]|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
A section with a non-zero height header will always cause that section to newline. Headers are always stretched to the
|
|
|
|
|
width of the collection view, pinched with the section insets.
|
|
|
|
|
|
|
|
|
|
Ex. of a section (2,0) with a header inset on the left/right.
|
|
|
|
|
```
|
|
|
|
|
|[ 0,0 ][ 1,0 ] |
|
|
|
|
|
| >======header=======< |
|
|
|
|
|
| [ 2,0 ] |
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Section insets apply to items in the section no matter if they begin on a new row or are on the same row as a previous
|
|
|
|
|
section.
|
|
|
|
|
|
|
|
|
|
Ex. of a section (2) with multiple items and a left inset.
|
|
|
|
|
```
|
|
|
|
|
|[ 0,0 ][ 1,0 ] >[ 2,0 ]|
|
|
|
|
|
| >[ 2,1 ][ 2,2 ][ 2,3 ]|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Interitem spacing applies to items and sections within the same row. Line spacing only applies to items within the same
|
|
|
|
|
section.
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
|
|
|
|
|
In a horizontally scrolling layout, sections and items are flowed vertically until they need to be "newlined" to the
|
|
|
|
|
next column. Headers, if used, are stretched to the height of the collection view, minus the section insets.
|
2017-02-11 01:58:52 +00:00
|
|
|
|
|
|
|
|
Please see the unit tests for more configuration examples and expected output.
|
|
|
|
|
*/
|
Swift name annotations
Summary:
This adds `NS_SWIFT_NAME` annotations to all public API's to provide cleaner integration into Swift:
- Removes the need to prefix classes in Swift code, instead rely on Swift module name spacing
- Adds more argument labels to C function API's like `IGListDiff([], [], .equality)` => `ListDiff(oldArray: [], newArray: [], option: .equality)`
While this is a large API change it should be as easy as:
- Find and replace `(IGList)([^K])` to `List$2` in Xcode with a scope set to Swift
- Build and follow compiler's auto fix corrections for C API's or any missed renames
I have not updated the documentation to reflect this yet, I am totally willing to do so but before I sink that amount of time into it I wanted to see if the Instagram team is even open to this change!
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
- [ ] I have updated the documentation
Closes https://github.com/Instagram/IGListKit/pull/593
Reviewed By: jessesquires
Differential Revision: D5028039
Pulled By: rnystrom
fbshipit-source-id: b473d874a1f9574e56b2ebaabd5b73d1b57d4bab
2017-05-09 21:29:52 +00:00
|
|
|
NS_SWIFT_NAME(ListCollectionViewLayout)
|
2019-01-17 15:50:48 +00:00
|
|
|
@interface IGListCollectionViewLayout : UICollectionViewLayout <IGListCollectionViewLayoutCompatible>
|
2017-02-11 01:58:52 +00:00
|
|
|
|
|
|
|
|
/**
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
Direction in which layout will be scrollable; items will be flowed in the perpendicular direction, "newlining" when they
|
|
|
|
|
run out of space along that axis or when a non-zero header is found.
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, readonly) UICollectionViewScrollDirection scrollDirection;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
Set this to adjust the offset of the sticky headers in the scrolling direction. Can be used to change the sticky
|
|
|
|
|
header position as UI like the navigation bar is scrolled offscreen. In a vertically scrolling layout, changing
|
|
|
|
|
this to the height of the navigation bar will give the effect of the headers sticking to the nav as it is collapsed.
|
2017-02-11 01:58:52 +00:00
|
|
|
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
@note Changing the value on this method will invalidate the layout every time.
|
2017-02-11 01:58:52 +00:00
|
|
|
*/
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
@property (nonatomic, assign) CGFloat stickyHeaderYOffset;
|
|
|
|
|
|
Show header when section item is empty
Summary:
Issue fixed: #1117
I adding a new constructor for making a `IGListCollectionViewLayout` instance that can always show sticky header although section data is empty.
It's working well and [this is demo project](https://github.com/marcuswu0814/IGListKit_ShowStickyHeaderWhenDataEmpty).
Bug I'm not sure is any good way to let this much more readability. Is there any good advice?
```objc
const CGRect headerBounds = (self.scrollDirection == UICollectionViewScrollDirectionVertical) ?
CGRectMake(insets.left,
(itemCount == 0) ? CGRectGetMaxY(rollingSectionBounds) : CGRectGetMinY(rollingSectionBounds) - headerSize.height,
paddedLengthInFixedDirection,
headerSize.height) :
CGRectMake((itemCount == 0) ? CGRectGetMaxX(rollingSectionBounds) : CGRectGetMinX(rollingSectionBounds) - headerSize.width,
insets.top,
headerSize.width,
paddedLengthInFixedDirection);
```
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/1129
Differential Revision: D7551628
Pulled By: rnystrom
fbshipit-source-id: a60b65a92efcea5175c86aaed1de02686ea6d20a
2018-04-09 15:28:05 +00:00
|
|
|
/**
|
|
|
|
|
Set this to `YES` to show sticky header when a section had no item. Default is `NO`.
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL showHeaderWhenEmpty;
|
|
|
|
|
|
2019-06-14 23:19:38 +00:00
|
|
|
/**
|
|
|
|
|
A bitmask of experiments to conduct on the adapter.
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) IGListExperiment experiments;
|
|
|
|
|
|
2017-02-11 01:58:52 +00:00
|
|
|
/**
|
|
|
|
|
Create and return a new collection view layout.
|
2017-03-31 19:59:23 +00:00
|
|
|
|
2017-04-18 16:30:53 +00:00
|
|
|
@param stickyHeaders Set to `YES` to stick section headers to the top of the bounds while scrolling.
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
@param scrollDirection Direction along which the collection view will be scrollable (if content size exceeds the frame size)
|
|
|
|
|
@param topContentInset The content inset (top or left, depending on scrolling direction) used to offset the sticky headers. Ignored if stickyHeaders is `NO`.
|
|
|
|
|
@param stretchToEdge Specifies whether to stretch width (in vertically scrolling layout) or height (horizontally scrolling) of last item to right/bottom edge when distance from last item to right/bottom edge < epsilon(1)
|
2017-03-31 19:59:23 +00:00
|
|
|
|
2017-02-11 01:58:52 +00:00
|
|
|
@return A new collection view layout.
|
|
|
|
|
*/
|
|
|
|
|
- (instancetype)initWithStickyHeaders:(BOOL)stickyHeaders
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
scrollDirection:(UICollectionViewScrollDirection)scrollDirection
|
2017-03-17 19:26:10 +00:00
|
|
|
topContentInset:(CGFloat)topContentInset
|
|
|
|
|
stretchToEdge:(BOOL)stretchToEdge NS_DESIGNATED_INITIALIZER;
|
2017-02-11 01:58:52 +00:00
|
|
|
|
Add horizontal scrolling support to IGListCollectionViewLayout
Summary:
Issue fixed: #752
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
This PR generalizes the layout logic in `IGListCollectionViewLayout.mm` to handle horizontally scrolling layouts, mainly by generalizing references to `width`, `height`, `x` and `y` to take scrolling direction into account. This changes the signature of `IGListCollectionViewLayout.init` as well as the names of a few properties, so it would be a breaking change.
I added a couple of unit tests specifically for horizontal layouts -- but held off from adding a horizontal version of *every* unit test for this class, as it would basically double the number of tests. But if you want that, just let me know and I'm happy to do it.
Also let me know if you want me to add a demo VC to the Examples project that uses this new horizontal flow layout -- I have some demo code handy (I used it for testing), but didn't want to clutter up the PR if you didn't want/need it.
Closes https://github.com/Instagram/IGListKit/pull/857
Reviewed By: ryanolsonk
Differential Revision: D5547266
Pulled By: rnystrom
fbshipit-source-id: 6094c45069fc265273d0f95c296fa78e47470384
2017-08-07 16:22:40 +00:00
|
|
|
/**
|
|
|
|
|
Create and return a new vertically scrolling collection view layout.
|
|
|
|
|
|
|
|
|
|
@param stickyHeaders Set to `YES` to stick section headers to the top of the bounds while scrolling.
|
|
|
|
|
@param topContentInset The top content inset used to offset the sticky headers. Ignored if stickyHeaders is `NO`.
|
|
|
|
|
@param stretchToEdge Specifies whether to stretch width of last item to right edge when distance from last item to right edge < epsilon(1)
|
|
|
|
|
|
|
|
|
|
@return A new collection view layout.
|
|
|
|
|
*/
|
|
|
|
|
- (instancetype)initWithStickyHeaders:(BOOL)stickyHeaders
|
|
|
|
|
topContentInset:(CGFloat)topContentInset
|
|
|
|
|
stretchToEdge:(BOOL)stretchToEdge;
|
|
|
|
|
|
2017-02-11 01:58:52 +00:00
|
|
|
/**
|
|
|
|
|
:nodoc:
|
|
|
|
|
*/
|
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
:nodoc:
|
|
|
|
|
*/
|
|
|
|
|
+ (instancetype)new NS_UNAVAILABLE;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|