diff --git a/Example/ScalingCarousel/StoryboardViewController.swift b/Example/ScalingCarousel/StoryboardViewController.swift index 89d224d..6eb6716 100644 --- a/Example/ScalingCarousel/StoryboardViewController.swift +++ b/Example/ScalingCarousel/StoryboardViewController.swift @@ -57,8 +57,10 @@ extension CarouselDatasource: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) + if let scalingCell = cell as? ScalingCarouselCell { scalingCell.mainView.backgroundColor = .red + scalingCell.cornerRadius = 40 } DispatchQueue.main.async { diff --git a/ScalingCarousel/Classes/ScalingCarouselCell.swift b/ScalingCarousel/Classes/ScalingCarouselCell.swift index 43766ae..ac54d55 100644 --- a/ScalingCarousel/Classes/ScalingCarouselCell.swift +++ b/ScalingCarousel/Classes/ScalingCarouselCell.swift @@ -32,6 +32,9 @@ open class ScalingCarouselCell: UICollectionViewCell { /// The minimum value to alpha to, should be set between 0 and 1 open var alphaMinimum: CGFloat = 0.85 + /// The corner radius value of the cell's main view + open var cornerRadius: CGFloat = 20.0 + // MARK: - IBOutlets // This property should be connected to the main cell subview @@ -87,6 +90,6 @@ open class ScalingCarouselCell: UICollectionViewCell { mainView.alpha = alphaValue // ..also..round the corners - mainView.layer.cornerRadius = 20 + mainView.layer.cornerRadius = cornerRadius } }