iOS Apps间分享数据
发布日期:2022-03-18 08:27:37 浏览次数:31 分类:技术文章

本文共 2375 字,大约阅读时间需要 7 分钟。

iOS Apps间分享数据

请参考:

总的来说有如下几种:

  • UIDocumentInteractionController
  • UIActivityViewController
  • Shared Keychain Access
  • Custom URL Scheme
  • Web Service
  • UIPasteboard + URL Scheme

UIDocumentInteractionController

请参考:

UIDocumentInteractionController文档见

注册APP支持的文件类型(Registering the File Types Your App Supports)

在Info.plist中使用CFBundleDocumentTypes键,对应的为array,可以包括如下的key:

  • CFBundleTypeName specifies the name of the document type(文件类型).
  • CFBundleTypeIconFiles is an array of filenames for the image resources to use as the document’s icon(图标).
  • LSItemContentTypes contains an array of strings with the UTI types that represent the supported file types in this group(UTI数组).
  • LSHandlerRank describes whether this application owns the document type or is merely able to open it(是否拥有or仅仅是打开).

UTI类型请参考:

打开支持的文件类型(Opening Supported File Types)

The system may ask your application to open a specific file and present it to the user. This typically occurs because another application encountered the file and used a document interaction controller to handle it. You receive information about the file to be opened in the application:willFinishLaunchingWithOptions: or application:didFinishLaunchingWithOptions: method of your application delegate. If your application handles custom file types, you must implement this delegate method (instead of the applicationDidFinishLaunching: method) and use it to initialize your application.

The options dictionary passed to the application:willFinishLaunchingWithOptions: or application:didFinishLaunchingWithOptions: method contains information about the file to be opened. Specifically, your application should look in this dictionary for the following keys:

  • UIApplicationLaunchOptionsURLKey contains an NSURL object that specifies the file to open.
  • UIApplicationLaunchOptionsSourceApplicationKey contains an NSString with the bundle identifier of the application that initiated the open request.
  • UIApplicationLaunchOptionsAnnotationKey contains a property list object that the source application wanted to associate with the file when it was opened.
    If the UIApplicationLaunchOptionsURLKey key is present, your application must open the file referenced by that key and present its contents immediately. You can use the other keys in the dictionary to gather information about the circumstances surrounding the opening of the file.

保存共享的文件

请参考:

参考

  • 列有常见的配置信息

转载地址:https://windzen.blog.csdn.net/article/details/50847902 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:iOS简单手势解锁
下一篇:iOS事件响应链介绍

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2023年05月30日 17时36分47秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

最新文章

pandoc讲html转换为pdf,mac下利用Pandoc、LaTeX 转换markdown成html,pdf 2019-08-28 15:52:28
android console命令,我们可以通过两种方式进入Android的console: 1. 直接执行命令emulator -shell; 2.... 2019-08-28 15:52:28
html加css作品,我的影视作品,如何在博客园发布带有CSS样式的HTML 2019-08-28 15:52:27
HTML.parser和正则解析,正则表达式+HTMLParser使用详.ppt 2019-08-28 15:52:27
如何配置android的adb环境变量,如何配置adb环境变量?win7配置adb环境变量的方法... 2019-08-28 15:52:26
android 项目部署,Android发布项目到JCenter 2019-08-28 15:52:26
Android的sqlite使用外部,Android 使用外部已经建立好的sqlite数据库 2019-08-28 15:52:25
android定位会出现的问题,android – 使用GPS_PROVIDER进行定位时出现问题 2019-08-28 15:52:25
android 发布最新系统更新包,安卓升级包(安卓补丁包更新) 2019-08-28 15:52:24
单片机与gsm通信c语言,gsm模块如何与单片机通信? 2019-08-28 15:52:24
dsp课程设计c语言源码,DSP课程设计-基于C语言实现256点的FFT精选.pdf 2019-08-28 15:52:23
单片机c语言6种开方,单片机快速开平方的算法 2019-08-28 15:52:23
随机数生成器c语言,句子随机生成器-怎么用C语言生成随机数 2019-08-28 15:52:23
c语言编程代码对父母感恩,c语言中编程:每个做父母的都关心自己孩子成人后孩子的生高:... 2019-08-28 15:52:22
c语言结构体定义字符串数组,C语言,结构体中字符串的声明(采用字符指针还是字符数组)... 2019-08-28 15:52:22
c语言系统时间的作用,C语言得到当前系统时间 2019-08-28 15:52:22
Linux下python包放在哪,在alpinlinux中使用apk安装的Python包 2019-08-28 15:52:21
linux系统怎么安装pr,Linux安装后的配置 2019-08-28 15:52:21
linux开启防火墙ping,如何在防火墙中放开ping 2019-08-28 15:52:20
linux下检测硬盘,【转载】linux下硬盘监控诊断工具SmartTools 2019-08-28 15:52:20