如何在iOS中的共享菜单中添加菜单项
我刚刚开始进入iOS开发,但是我必须尽早做的事情就是在系统菜单上添加一个按钮,例如Dropbox在与电子邮件附件交互时添加了按钮。
此应用程序将用于video,因此在快速播放器的共享菜单上添加按钮将是理想的选择。
我已经搜索了文档并且只找到了UIMenuItem类。 这是我想要的还是有另一种方法来实现这个function?
-
设置project-info.plist – >添加新项(UTExportedTypeDeclarations)
UTExportedTypeDeclarations UTTypeConformsTo com.apple.quicktime-movie UTTypeIdentifier com.company.project UTTypeTagSpecification -
在.m文件中编写ButtonClick事件
-(IBAction)actionClick:(id)sender{ UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL: [NSURL fileURLWithPath:MOVIE_FILE_PATH]]; documentController.delegate = self; documentController.UTI = @"com.apple.quicktime-movie"; [documentController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; }