I. Saving and Sharing Data: Concepts, Terminology, and Options
1. Using Documents
People are used to word processing and spreadsheet documents, but these formats have not always been easy to implement with iOS and macOS. The key feature of documents is that they are visible to users on their device; once visible, users can share those documents, save them, name and rename them, and store them in folders.
By contrast, other types of data storage such as databases and macOS or iOS formats such as property lists let users store and use data in formats that are not visible to the user.
The terms “file” and “document” are often used interchangeably, but they are not the same. This chapter provides the basic definitions and distinctions that are used throughout this book and the Apple (and other) software.
2. Looking Inside Documents
Documents have a format that organizes the data contained in the document such as:
• Standard File Formats (graphics and text) These document formats are can be shared with other apps on other devices so that you can read and write documents created or edited on Microsoft Word, Numbers, or other apps.
• Custom document formats. You can create formats that your apps can read and write; other apps may not be able to read and write them.
• Working with Composite Documents (file managers). Documents can consist of several file formats such text (perhaps a .doc or .docx file) as well as graphics (.jpeg or .png).
3. Matching a Document to a Document FormatThe key to using documents on any devices is matching the document format to the physical document description. Originally, this was done simply with file extensions such as .txt or .GIF but as computers and formats have become more complex, those tools are not sufficient.
This chapter provides the key technologies used to match documents and formats on iOS and macOS:
• Document identifiers
• Document types
• Document protocol conformance (mixing and matching formats)
II. Implementing Documents on iOS and macOS
4. Securing and Protecting Data
As soon as you start thinking about saving data, you should be thinking about the security of that data. Every step of the process from deciding what data to store and what rules to implement for safeguarding that data needs to be considered. This chapter focuses on those issues.
• Security and Privacy (access control)
• Security and Protection (managing changes to data)
• Encryption of Data
• Data at rest
• Data in action
Using Versions to manage Formats
• Data formats and versions
• File formats and versions
• Implementing conversions
5. Implementing Documents on macOS: NSDocument and NSDocumentController
Chapters 5 and 6 have the same outline but the content is different from iOS and macOS
There are two main implementation issues on macOS:• Browsing files
• New Documents
• Using document files
6. Implementing Documents on IOS: UIDocument and UIDocumentBrowserViewController
Chapters 6 and 7 have the same outline but the content is different from iOS and macOS
There are two main implementation issues on iOS:• Browsing files
• New Documents
• Using document files
7. Sharing Documents with Share Buttons and UIActivityViewController
Your document formats work well with share buttons where you can share all or part of your documents. This chapter provides the structure for implementing share buttons for documents.8. Crossing Platforms with Documents
This chapter explores the issues involved in using documents across platforms and the steps to take to make that work easily.
• Making Documents for iOS and macOS Compatibility
• Objects, structures and formats that need conversion
• Handling document conflicts in iCloud
• Providing Compatibility with Major Platforms
• Playing Nice with Microsoft Office and Related Apps• Collaborating with Google Docs
• Sharing with Microsoft OneDrive
• Open Office and Other Formats
III. Building Other Data Storage Tools
9. Using User Defaults for Data and Settings on iOS Devices
10. Using User Defaults for Data and Settings on macOS Devices
11. Adding new Document Formats
• Open Formats (.doc, etc.)
• Shared Formats
• For Your Apps and Groups
• For Other Apps and Groups
• Building Composite Documents with File Managers
Rise above the basics of Xcode app development to implement tools like Share buttons and activity view controllers to share document content including parts of documents with other users and with other devices. This book fills the gap so that developers with even a fundamental knowledge of iOS and Swift can implement document creation, saving, and sharing in their apps.
What You'll Learn
Utilizziamo i cookie di profilazione, anche di terze parti, per migliorare la navigazione, per fornire servizi e proporti pubblicità in linea con le tue preferenze. Se vuoi saperne di più o negare il consenso a tutti o ad alcuni cookie clicca qui. Chiudendo questo banner o proseguendo nella navigazione acconsenti all’uso dei cookie.