图 1 是我写的 App ,没有 Word 这个 App ;
图 2 是 QQ 文件分享。
图 1
图 2
Code :
if let filePath = NSBundle.mainBundle().pathForResource("test", ofType: "doc") {
let url = (NSURL(fileURLWithPath: filePath), filePath)
let objectsToShare = [url]
let controller = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
presentViewController(controller, animated: true, completion: nil)
}
1
Shared 2016-01-18 16:35:07 +08:00 2
UIDocumentInteractionController
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/ |
2
Shared 2016-01-18 16:38:53 +08:00 1
|