Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.

Commit ae1d0e2

Browse files
author
Anna-Mariia Shkarlinska
committed
Add top view height configuration
1 parent a88e4c5 commit ae1d0e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CarLensCollectionViewLayout/CarLensCollectionViewCell.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ open class CarLensCollectionViewCell: UICollectionViewCell {
1919
/// The bottom view of the cell.
2020
public var cardView: UIView!
2121

22-
private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170
22+
/// The height of the top view.
23+
public var topViewHeight: CGFloat!
2324

2425
/// Configuration of the cell. Must be called on a start.
2526
///
2627
/// - Parameters:
2728
/// - topView: The upper view of the cell.
2829
/// - cardView: The bottom view of the cell.
29-
open func configure(topView: UIView, cardView: UIView) {
30+
/// - 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.
31+
open func configure(topView: UIView, cardView: UIView, topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170) {
32+
self.topViewHeight = topViewHeight
3033
self.topView = topView
3134
self.cardView = cardView
3235
setupView()

0 commit comments

Comments
 (0)