I have code to retrieve the ubiquitousItemDownloadingStatus resource value of a url:
do {
let resourceValues = try item.url.resourceValues(forKeys: [URLResourceKey.ubiquitousItemDownloadingStatusKey]
} catch {
print(error.localizedDescription)
}
However, I don't know what to do with the value. I am able to access the resource value with the following code:
do {
let resourceValues = try item.url.resourceValues(forKeys: [URLResourceKey.ubiquitousItemDownloadingStatusKey])
resourceValues.ubiquitousItemDownloadingStatus // ???
} catch {
print(error.localizedDescription)
}
But I'm not sure what to do after that. The declaration of the resource value in the Foundation Library is a struct, as follows:
public struct URLUbiquitousItemDownloadingStatus : Hashable, Equatable, RawRepresentable {
public init(rawValue: String)
}
extension URLUbiquitousItemDownloadingStatus {
@available(iOS 7.0, *)
public static let notDownloaded: URLUbiquitousItemDownloadingStatus
@available(iOS 7.0, *)
public static let downloaded: URLUbiquitousItemDownloadingStatus
@available(iOS 7.0, *)
public static let current: URLUbiquitousItemDownloadingStatus
}
I'm confused because I expect an enum.
Please if anyone can help clarify this for me I would appreciate it.