开发者

Tweetie 2/Facebook-like swipe gesture in UITableview?

Hey everyone, I was just wondering if anyone knows how to create a UITableviewCell swipe effect akin to the one in the Tweetie 2.0 app (see video: Tweetie 2.0) or in the Facebook 3.0 app (when pressing the blue "+" next开发者_StackOverflow to a status).

What I need to do is to have the cell slide away in response to you swiping it and reveal a background view.

Any help would be appreciated!


Both Tweetie and Facebook implement their own 'custom' swipe detection. What I mean is that instead of using the standard UITableView hooks for swipes, you override touchesBegan:withEvent:, touchesMoved:withEvent:, et.c in your own subclass of UITableView. You can then start detecting swipes yourself and call whatever methods you want on your UITableViewCell's. (Hint: to get the cell given an UITouch, use the UITableView method indexPathForRowAtPoint:)

There's also a another plus to managing your own swipes: you get a lot more control over how accurate each swipe needs to be.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜