【发布时间】:2015-09-24 23:07:03
【问题描述】:
我正在尝试在我的应用程序中实现 peek and pop 功能。但是由于我还不能测试它,我想知道我是否正确地执行它,我觉得有什么问题吗?
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location
{
NSLog(@"TEST");
NSIndexPath *indexPath = [self.myTableView indexPathForRowAtPoint:location];
if (indexPath) {
UITableViewCell *cell = [self.myTableView cellForRowAtIndexPath:indexPath];
NSDictionary *dict = [self.array objectAtIndex:indexPath.row];
cell.textLabel.text = [dict objectForKey:@"name"];
DetailViewController *previewController = [[DetailViewController alloc] init];
// previewController.content = content;
previewingContext.sourceRect = cell.frame;
return previewController;
}
return nil;
}
【问题讨论】:
标签: ios objective-c xcode ios9 3dtouch