I’m building an app with NSFetchResultsController. For that I use the CoreDataTableViewController classes. So all my tableviewControllers are derived from this class.
@interface MultimediaViewController : CoreDataTableViewController
So now I want to add a view on top of that tableview. I have a storyboard like this.
It is showing it correctly on top of the tableview, but when I scroll down it disappears, but I want it to always stay on top. How can I do this? Keep in mind that I always need my viewcontroller derived from the CoreDataTableViewController – class.
Can anyone please help me, I am searching at this for days but doesn’t find a proper solution. If you really want to help me I will mail you my project for more details.
Kind regards.
You want your “view on top of that tableview” to be a subview of the table view. A table view is a scroll view (UIScrollView). I don’t know what a CoreDataTableViewController is, but presumably it has access to a table view. That means you can set a delegate on that table view, which means you’ve set a delegate on the scroll view. (You may have to put code in whatever class is already being used as the table view delegate in this case.) That means you can use the scroll view delegate to detect when the scroll view is scrolled, which means that its contents offset has changed. Now you change the frame of the “view on top of the tableview” to compensate for the change in the scroll view’s contents offset.