Skip to content

Instantly share code, notes, and snippets.

@dirtyhenry
Created January 22, 2020 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirtyhenry/ced0aef8a354f80c22e4a8b6ff3e06b2 to your computer and use it in GitHub Desktop.
Save dirtyhenry/ced0aef8a354f80c22e4a8b6ff3e06b2 to your computer and use it in GitHub Desktop.
URL Building
let url1 = try! FileManager.default.url(for: .documentDirectory,
in: .userDomainMask,
appropriateFor: nil,
create: false)
.appendingPathComponent("1234")
let url2 = URL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0])
.appendingPathComponent("1234")
debugPrint("Same URL? \(url1 == url2)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment