Display Contents of PDF opened in iOS App (Swift) -
i have app configured pdfs in other applications such mail, can hold down on pdf , have open "open in" app; have working , app opens, want display document in app, how do that? pretty sure have use appdelegate, started using swift , lost , cannot find tutorial helps task, appreciated.
appdelegate.swift
class appdelegate: uiresponder, uiapplicationdelegate {
var window: uiwindow? let uiapplicationlaunchoptionsurlkey: string = "" func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { if uiapplicationlaunchoptionsurlkey.isempty { print("string empty.") } else{ let alertview:uialertview = uialertview() alertview.title = "pdf upload" alertview.message = "??" alertview.delegate = self alertview.addbuttonwithtitle("ok") alertview.show() } return true }
in appdelegate's didfinishlaunchingwithoptions, can handle setting ui display pdf. can use uiwebview render document.
iphone : can open pdf file using uiwebview?
edit:
this link explains launch options can listen in appdelegate. didfinishlaunchingwithoptions. uiapplicationlaunchoptionsurlkey contain url pointing file.
Comments
Post a Comment