I want to create a subclass of UITableView
or UIScrollView
that will have some shading at the top when the content offset is > 0 to indicate that the content is scrollable. (See image attached)
The way I'm implementing it right now is using the UIViewController
that is the delegate of the tableView
. I simply have a GradientView
on top of the tableView
, and I intercept scrollViewDidScroll:
to animate the visibility of that top gradient.
My problem with this implementation is that it's not "clean". I want my UIViewControllers
to take care of logic, and not to deal with applying gradients and stuff. I wish I could just drop a subclass of UITableView
that will do that for me.
The challenge for me is that I can't figure out how the tableView
could add to itself a fixed content on top of the scrollable content.
Another question is what method/s of UIScrollView
should I override to intercept the scrolling event. Obviously I don't want the tableView to be the delegate of itself...
Any ideas?
Thanks!