Swift Tip – Accessing a User’s Documents Directory with URL Extension

1 · Andrew Bancroft · April 10, 2017, 6:01 p.m.
When you need to access the documents directory on a user’s device, what do you do? In the past, I know I’ve gotten used to typing out the same set of code over and over throughout my apps. I know, I know – DRY – don’t repeat yourself. One way to simplify this is to use a Swift extension to URL. Doing this will help you centralize where this code is located in your app, and keep your code DRY....