Added ifFileExistsForPageType function.

This commit is contained in:
mayur nilwant 2024-06-10 18:22:15 -04:00
parent 2b8bd98bf0
commit 9e520a9b87

View File

@ -110,4 +110,14 @@ public class CachedData: Codable {
@objc public func removeAllAppLevel() throws {
try FileManager.default.removeItem(at: appLevelCacheDirectory)
}
@objc public func ifFileExistsForPageType(path: URL) -> Bool {
if #available(iOS 16.0, *) {
return FileManager.default.fileExists(atPath: path.path())
} else {
return FileManager.default.fileExists(atPath: path.absoluteURL.path)
}
}
}