Reputation: 7031
I've created a UITableViewController in my storyboard, and added a UIView as a tableHeaderView. I have an MKMapView in the tableHeaderView, but my problem is that the map in the tableHeaderView doesn't receive touches before the tableView completely stops scrolling. Rather if a touch occurs before the scroll ends decelerating, the scroll continues, and this is unwanted behaviour.
I've already tried subclassing the UITableView to override hitTest, but can't figure out what to return as the output of events within the tableHeaderView are as follows:
<MKNewAnnotationContainerView: 0x1589ac3a0; frame = (0 0; 375 310.5); autoresize = W+H; autoresizesSubviews = NO; layer = <CALayer: 0x170c3c5e0>>
So, is there a way to interact with the tableHeaderView simultaneously when the scrollView is decelerating?
Upvotes: 1
Views: 329
Reputation: 325
It seems TableHeaderViews are not really made for things like this. You should simply add the MKMapView at the top of the UITableView, this will solve your problem.
Upvotes: 0