From 739fe0c8def2fdb09a6e17d9098ace40f2349668 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 11 Jan 2025 03:19:59 +0100 Subject: [PATCH] Implemented the "init(at: )" initialiser function for the URL+Inits extension in the Library target. --- Sources/Library/Extensions/URL+Inits.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Sources/Library/Extensions/URL+Inits.swift diff --git a/Sources/Library/Extensions/URL+Inits.swift b/Sources/Library/Extensions/URL+Inits.swift new file mode 100644 index 0000000..7c31114 --- /dev/null +++ b/Sources/Library/Extensions/URL+Inits.swift @@ -0,0 +1,15 @@ +import Foundation + +extension URL { + + // MARK: Initialisers + + init(at filePath: String) { + if #available(macOS 13.0, *) { + self = URL(filePath: filePath) + } else { + self = URL(fileURLWithPath: filePath) + } + } + +}