Open Xcode and click Get started with a playground in the Welcome to Xcode window, or choose File/New/Playground… Set the name of the playground to Files, make sure the Platform is set to macOS and click Next. Each file has its own address the structure that defines this address is named URL. This means that finding a particular file can be complicated. MacOS uses a hierarchical file system: files & folders inside folders, inside folders.
In this tutorial, you’ll learn how to manage directory paths, work with URLs, use common file and folder dialogs, display file and folder information, and much more! Getting Startedįor this tutorial, you’ll start with a playground and move on to an app later once you’ve learned the basics.
With files and data spread all over the filesystem, how can your app find out about files and folders, work with file and folder paths, and even read and write data to a file? Your app is stored in the Applications folder, users store documents in their Documents folder, and preferences and support files are stored in the users Library folder.
The file system in macOS underlies every app - and the FileManager class has a lot to do with that.