Closed GoodSir42 closed 4 years ago
Glad you like it! I'll make the changes and update my branch with it. The usage is really straightforward, so the doc should be done fast.
Hi again,
I finally found some time to get the code updated with an example and noticed that I have issues properly determining the center cell like that:
`open var currentCenterCell: UICollectionViewCell? {
let lowerBound = inset - 20
let upperBound = inset + 20
for cell in visibleCells {
let cellRect = convert(cell.frame, to: nil)
if (scrollDirection == .horizontal && cellRect.origin.x > lowerBound && cellRect.origin.x < upperBound) ||
(scrollDirection == .vertical && cellRect.origin.y > lowerBound && cellRect.origin.y < upperBound)
{
return cell
}
}
return nil
}`
I don't really understand why the upper and lower bounds are inset +- 20. maybe you can have a look and let me know how to fix this?
Hi @Eifelschaf, the upper and lower bounds need to take the cell inset
into account. The 20
is a number to try to avoid false positives.
What issue are you experiencing?
I fixed the issues with the spacing everything looks good now.
Closing as stale
Hi! I modified your library to allow changes to the orientation of the carousel. Would you be interested in merging this into the main library?