Determine when UICollectionViewCell is % off screen as I scroll horizontally - ios

I have a UICollectionView that scrolls horizontally. As I scroll left or right I would like to be able to determine when the most left or first cell is say, 60% off the screen and 40% on screen.
Eventually, I would like to do the same for when I scroll to the right and determine the same for the last cell or most right cell.
Thanks for the help.

Related

Swift collectionView hiding layout guidance

I am looking to create a certain layout with a collection view. Where there are 2 sections to the main viewController, the first being static on the page, and the second being a collectionView which moves over the other when the user scrolls. I want the collectionView to have a limit of how much it cover the static content (it should have a minimum and maximum inset that it can covert). The collectionView has a button which "hangs over" the static section. I have attached some images to describe this further.
I have thought of a few ways to achieve this, the most promising being a collectionView with a top contentInset of the 'max scrolled down' height. This would show the content underneath and allow the collectionView to be scrolled up and cover it. the button which "hangs over" would be a subview of the collectionView and would also show the rounded corners and drop shadow.
Problems:
couldn't continue scrolling the collection view whilst also pinning the header to the top
If anyone has any suggestions of how to go about this, please let me know! Thank you.

Scrolling to CollectionView Cell that is off screen

I'm designing a UI with a horizontal collection view (see below) I can scroll left or right to see the cells but when I let go, it bounces back to the center. The behavior I want is that when you scroll to cells off screen, it stops on them (not bounces back). Unchecking Bouncing on Scroll in the attributes inspector has no impact, unchecking Bounce Horizontally doesn't let me scroll at all. How can I achieve the desired behavior?

UICollectionView specific cell bring front of oder cell

As you can see in below video, in collectionView there are 3 cells. I want it become bigger when I touch in centre. everything is OK except one thing.
As you can see in video when order cell is visible and centre cell is bigger in bring to back of visible cell and make it untouchable.
https://www.dropbox.com/s/cn4ujvr6t9f9e2c/ScreenRecording_07-14-2018%2013-08-04.MP4?dl=0
Is there any solution that centre cell always be in front of order cell?

Snap to cell in a UICollectionView

I am currently using a CollectionView within my UIViewController that scrolls horizontally through a variable number of cells (There are 3 cells visible on the display at a time). I want it so that when the user finishes scrolling that the view smoothly snaps/pulls to the cell closest to the center of the screen. Does anyone have suggestions on how this could be done?

How to allow UICollectionView to scroll in intervals of the cell width

I have a UICollectionView that scrolls sideways. When it is scrolled I want it to land on a multiple of the cell width. The cells are diamonds and must fit in a very precise location.
Example: If user scrolls, then the scroll will happen as normal (or maybe semi-paged) and then when it stops, make sure it stops at a multiple so the cell can be aligned with the diamonds.
Any idea how to approach this?

Resources