Implemented the "init(at: )" initialiser function for the URL+Inits extension in the Library target.
This commit is contained in:
parent
2128c0cde2
commit
739fe0c8de
15
Sources/Library/Extensions/URL+Inits.swift
Normal file
15
Sources/Library/Extensions/URL+Inits.swift
Normal file
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user