【发布时间】:2016-10-17 01:09:09
【问题描述】:
我在这样设置的 UITableView 上有一个手势
//tableView:cellForRowAtIndexPath:
UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[cell addGestureRecognizer:lpgr];
在我的应用委托中,我正在处理这样的快捷方式
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
if (url == nil) {
NSLog(@"Shortcut: None");
return NO;
}
NSLog(@"Shortcut: %@", [url absoluteString]);
NSURLComponents *urlC = [[NSURLComponents alloc] initWithURL:url resolvingAgainstBaseURL:NO];
if ([urlC.scheme isEqualToString:@"file"]) { //file:///private/var/mobile/...../Documents/Inbox/file.pdf
FSCategoriesTVC *FSCategoriesTVC = [_window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"FSCategoriesTVC"];
FSCategoriesTVC.isUploadingFile = YES;
FSCategoriesTVC.fileToUpload = url;
FSCategoriesTVC.navigationItem.prompt = @"Select project to add files to";
UINavigationController *navController = [[UINavigationController alloc] init];
[navController setViewControllers:@[FSCategoriesTVC] animated:NO];
if(_window.rootViewController.presentedViewController != nil) {
[_window.rootViewController dismissViewControllerAnimated:NO completion:^{ }];
}
[_window.rootViewController presentViewController:navController animated:NO completion:^{}];
return YES;
}
return NO;
}
我正在做的是在我的应用程序中打开 .pdf 文件并将它们上传到 S3 以供稍后查看。但是,当应用程序以这种方式启动时,我的手势无法识别
e:我用一个名为 BAMContextualMenu 的框架替换了手势,希望这能解决我的问题,不。同样的问题,从快捷方式启动时无法识别手势
【问题讨论】:
标签: ios document-types