Implementing iOS and macOS Documents with the Files App by Jesse Feiler

Implementing iOS and macOS Documents with the Files App by Jesse Feiler

Author:Jesse Feiler
Language: eng
Format: epub
ISBN: 9781484244920
Publisher: Apress


The code is shown in Listing 7-2.class DocumentViewController: UIViewController {

@IBOutlet weak var documentNameLabel: UILabel!

var document: UIDocument?

override func viewWillAppear(_ animated: Bool) {

super.viewWillAppear(animated)

// Access the document

document?.open(completionHandler: { (success) in

if success {

// Display the content of the document, e.g.:

self.documentNameLabel.text

self.document?.fileURL.lastPathComponent

} else {

// Make sure to handle the failed import appropriately,

// e.g., by presenting an error message to the user.

}

})

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.