You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 18, 2022. It is now read-only.
/// - topViewHeight: An optional parameter to specify the custom height of the top view. The default value is `170` or `200` depending on a device's size.
// In this header, you should import all the public headers of your framework using statements like #import <CarlensCollectionViewLayout/PublicHeader.h>
16
+
// In this header, you should import all the public headers of your framework using statements like #import <CarLensCollectionViewLayout/PublicHeader.h>
/// The optional configuration of CarLensCollectionViewLayout. Use this if you need to customize `CarLensCollectionViewLayout`.
11
+
publicstructCarLensCollectionViewLayoutOptions{
12
+
13
+
/// A minimum spacing between cells.
14
+
letminimumSpacing:CGFloat
15
+
16
+
/// A deceleration for a scroll view.
17
+
letdecelerationRate:UIScrollView.DecelerationRate
18
+
19
+
/// A value indicating whether collection view should have a scroll indicator.
20
+
letshouldShowScrollIndicator:Bool
21
+
22
+
/// The size to use for cells.
23
+
letitemSize:CGSize?
24
+
25
+
/// The initialization of the optional layout configuration.
26
+
/// You can initialize it with any of the parameters available. Others will be configured automatically.
27
+
///
28
+
/// - Parameters:
29
+
/// - minimumSpacing: A minimum spacing between cells. The default value is `20`.
30
+
/// - decelerationRate: A deceleration for a scroll view. The default value is `.fast`.
31
+
/// - shouldShowScrollIndicator: A value indicating whether collection view should have a scroll indicator. The default value is `false`.
32
+
/// - itemSize: The size to use for cells. The default height is equal to a collection view height. The width is equal to the `collection view width - 60`.
@@ -42,7 +44,41 @@ class CollectionViewCell: CarLensCollectionViewCell {
42
44
}
43
45
}
44
46
```
45
-
The sample implementation is available in [Demo](CarLensCollectionViewDemo) project.
47
+
The sample implementation is available in [Demo](CarLensCollectionViewLayoutDemo) project.
48
+
49
+
### Customization
50
+
51
+
#### Layout
52
+
You can also initialize `CarLensCollectionViewLayout` with a `CarLensCollectionViewLayoutOptions` object by passing any of the parameters available. Others will be configured automatically.
53
+
54
+
**Parameters:**
55
+
56
+
`minimumSpacing` - A minimum spacing between cells.
57
+
58
+
`decelerationRate` - A deceleration for a scroll view.
59
+
60
+
`shouldShowScrollIndicator` - A value indicating whether collection view should have a scroll indicator.
61
+
62
+
`itemSize` - The size to use for cells.
63
+
64
+
Example:
65
+
```swift
66
+
let options =CarLensCollectionViewLayoutOptions(minimumSpacing: 40)
While subsclassing `CarLensCollectionViewCell` you can call `configure(...)` with an additional parameter `topViewHeight`. The card view height will be calculated based on this value.
0 commit comments