iOS 11 Files app integration and the UIDocumentBrowserViewController

My original article — How to Integrate Your App with Files App in iOS 11 — was published on appcoda.com.

In this tutorial I’ll show you how to embrace iOS 11’s Files app. First, I’ll walk you through configuration of an app so that any files stored in its iOS file system-based “Documents” folder are made visible in the Files app and exposed to other apps installed on your device. Second, I’ll demonstrate how you can incorporate a Files app-like interface and functionality into your own apps. All of the Swift code I wrote to accomplish these two tasks is included below — and I’ve taken lots of screenshots regarding Files app integration. Sit back, enjoy, and learn about a fundamental paradigm shift in the iOS zeitgeist, moving from a “hide-the-details” (like hiding individual files) mindset to providing users with the ability to look at and manipulate files related to their apps using a macOS Finder-like interface, except on iOS.

To pique your interest, let’s look at a feature I encoded in the final app for this tutorial. We’ll use my app, named “Document-Based App,” to view an image file in the app’s main folder:

Continue reading “iOS 11 Files app integration and the UIDocumentBrowserViewController”

Introduction to MVVM: refactoring an MVC app using the MVVM design pattern

My original article — Introduction to MVVM: refactoring a MVC app using the MVVM design pattern — was published on appcoda.com.

[Download the Xcode 9 project from GitHub so you can follow along with my code explanation and try MVVM yourself!]

Design patterns are very important tools for iOS developers to keep in their software engineering arsenals. These patterns, along with several other best practices I’ll mention below, help developers to create reliable and maintainable apps. In other words, design patterns help in managing software complexity. In this tutorial, I’ll introduce you to the “Model-View-ViewModel” or “MVVM” design pattern. For a historical and pragmatic perspective, I’ll compare the very well-known “Model-View-Controller” or “MVC” design pattern, long favored by many iOS developers, to MVVM, which has steadily been gaining traction among the same group of developers.

In order to help you understand these design patterns, I’ll walk you through the design and coding of my app shown here:

Continue reading “Introduction to MVVM: refactoring an MVC app using the MVVM design pattern”