how to detect a "quick touch" on a UITableView for the purpose of toggling to/from full screen?
What is the coding to detect a "quick touch" on a UITableView for the purpose of toggling to/from full screen?
In particular this is because the user is on a UITableView they would still need the ability to drag the list of items up/down, and potentially click on a cell/row to dig deeper. But if they touched quickly then this could be the trigger to toggle between full-screen mode (i.e. nav bar & tool bar).
Background - When I say toggling to/from full screen I'm refering to carrying out what is described here, h开发者_Python百科owever in this answer there was no mention in terms of how to plug this into the callbacks for a UITableView which is being displayed within a UINavigationController stack.
The following code might help you
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
timeStampStart = event.timestamp;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
timeStampEnd = event.timestamp;
touchDuration = timeStampEnd - timeStampStart;
if(touchDuration > smallTimeStamp)
[super touchesEnded:touches withEvent:event];
else
[self zoomMyTableView];
}
Wanted to put up this as a possible answer, the answer being there is no relative straight way to achieve what I've asked for this. That is a way for a tap or double-tap to be detected in a UITableView page, which is already picking up row touches and scroll up/down etc.
Haven't verified whether this is the case or not, but people could up-vote this answer if they believe this to be true. (also waiting on sample from ypk who perhaps has an answer)
精彩评论