标签:完成 tty 保存 apple err mod 制作 htm picker
UIDocumentPickerViewController和UIDocumentInteractionController
重点要了解UIDocumentPickerViewController在初始化的时候inMode的四种模式:
这个类相对简单一点,重点是要实现在delegate里面的3个方法, 这样视图控制器才能显示出来:
#pragma mark - UIDocumentInteractionControllerDelegate
-(UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller{
return self;
}
-(UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller{
return self.view;
}
-(CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller{
return self.view.bounds;
}
苹果支持的文件类型使用UTI标识
在info.plist上配置app里面支持读取查看支持的文件类型
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>com.myApp.surpportFiles</string>
<key>LSItemContentTypes</key>
<array>
<string>public.image</string>
<string>public.audio</string>
<string>public.movie</string>
<string>public.data</string>
<string>public.text</string>
<string>public.archive</string>
<string>public.item</string>
<string>public.source-code</string>
</array>
</dict>
</array>
UIDocumentPickerViewController和UIDocumentInteractionController
标签:完成 tty 保存 apple err mod 制作 htm picker
原文地址:https://www.cnblogs.com/zhouhui231/p/12183125.html