14 lines
306 B
Swift
14 lines
306 B
Swift
// String.swift
|
|
|
|
import Foundation
|
|
|
|
extension String {
|
|
public var expandingTildeInPath: String {
|
|
return NSString(string: self).expandingTildeInPath
|
|
}
|
|
|
|
func toURL() -> URL? {
|
|
return hasPrefix("https://") ?
|
|
URL(string: self) : URL(string: "https://\(self)")
|
|
}
|
|
}
|