I have a simple table with table sections, cells and a tableFooterView.
The footer is just an image with a shadow gradient. When I scroll to the bottom, I want the table to snap to the bottom of the last cell, and only show the shadow when you scroll beyon this, and then it should snap back to the bottom of the last cell, thus hiding the footer again.
I’ve tried to search for this, but I don’t seem to find the right keywords (still new to xcode, and the cryptic/long names on everything), all I find is people wanting to enable/disable bounce, or people wanting to add custom buttons to the footer.
Could anyone point me in the right direction?
A
UIScrollView, the superclass ofUITableView, can be a miserable creature. There is so much behavior programmed into them that sometimes what would seem on paper to be an easy proposition can be hard. Add to that the fact that this is a table-view and it just gets worse.If you are determined to use the
UITableView‘stableFooterViewproperty to accomplish this, I have had limited(very) success using:These are
UIScrollViewDelegatemethods, your view controller is likely already the table-view’s delegate.I would suggest simply adding a gradient to your view-controller’s view property. That way when the table scrolls offscreen you will see the gradient behind it. Then you will get most of the behavior you want for free.