【发布时间】:2015-07-21 19:24:38
【问题描述】:
我有一个应用程序被配置为在其他应用程序(如邮件)中使用 PDF,我可以按住 PDF,它可以打开以“在”我的应用程序中“打开”;我有这个工作并且我的应用程序打开了,但现在我想在我的应用程序中显示该文档,我该怎么做?我很确定我必须使用 AppDelegate,但我刚开始使用 Swift,完全迷失了方向,找不到可以帮助完成此任务的教程,因此我们将不胜感激。
AppDelegate.swift
类 AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let UIApplicationLaunchOptionsURLKey: String = ""
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if UIApplicationLaunchOptionsURLKey.isEmpty {
print("String is empty.")
}
else{
let alertView:UIAlertView = UIAlertView()
alertView.title = "PDF UPLOAD"
alertView.message = "??"
alertView.delegate = self
alertView.addButtonWithTitle("OK")
alertView.show()
}
return true
}
【问题讨论】: