0

我将TTThumbsViewController分类为集成上传过程。作为回报,我也想整合一个删除过程。如何通过手势识别由Three20在TTThumbsViewController中触摸的照片?

我的情况: 我增加了一个GestureRecognizer上点击照片:

UILongPressGestureRecognizer* recognizer = [[UILongPressGestureRecognizer alloc] 
              initWithTarget:self action:@selector(deleteImage:)]; 
[self.view addGestureRecognizer:recognizer]; 

...

- (void)deleteImage:(UILongPressGestureRecognizer*)recognizer { 
    __block IMHRemotePhoto *photo = [self.dataSource 
            tableView:self.tableView 
            objectForRowAtIndexPath:[self.tableView 
            indexPathForRowAtPoint:gestureStartPoint]]; 

} 

但与片断我只认行,而不是我选择TTThumbsViewController对象默认情况下可能最多有4个元素连续排列。

任何想法如何做到这一点?

最好的问候,hijolan

回答

0

你总是可以使用则hitTest功能的UIView

TTThumbView * selectedThumb = [self.tableView hitTest:point withEvent:nil]; 
if (selectedThumb && [selectedThumb isKindOfClass:[TTThumbView class]]) { 
    // Do something with this thumb 
} 
+0

我会试试看未来几周内并标出答案权之后。我还发现了另一种解决方法,我也将发布它......感谢您的回答,hijolan – 2012-02-29 15:35:59