我刚开始接触iOS开发,但是我需要尽早在系统菜单中添加一个按钮,就像Dropbox在处理电子邮件附件时添加了它的按钮。
这个应用程序是用于视频的,因此在快速时间播放器的共享菜单中添加一个按钮是理想的。
我已经查阅了文档,只找到了UIMenuItem类。这是我想要的吗?还是有其他实现此功能的方法?
我刚开始接触iOS开发,但是我需要尽早在系统菜单中添加一个按钮,就像Dropbox在处理电子邮件附件时添加了它的按钮。
这个应用程序是用于视频的,因此在快速时间播放器的共享菜单中添加一个按钮是理想的。
我已经查阅了文档,只找到了UIMenuItem类。这是我想要的吗?还是有其他实现此功能的方法?
Set project-info.plist -> add new item (UTExportedTypeDeclarations)
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.apple.quicktime-movie</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.company.project</string>
<key>UTTypeTagSpecification</key>
<dict/>
</dict>
</array>
Coding your ButtonClick event in .m file
-(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];
}