I am using NSFileProviderItemCapabilities to manage functionality available to a user. One feature is whether the user can download a file or not. NSFileProviderItemCapabilities does not have this capability supported out-of-the-box.
I created the following
extension NSFileProviderItemCapabilities
{
public static var allowsDownloading: NSFileProviderItemCapabilities {
// All NSFileProviderItemCapabilities raw values go up in powers of 2 (expect allowsAll which is 63)
return NSFileProviderItemCapabilities(rawValue: 62)
}
}
var capabilities = Capabilities()
capabilities.insert(.allowsDownloading)
Using this custom capability results in the following being stored in the capabilities variable.
No allowsDownloading is present and other NSFileProviderItemCapabilities have been added.
Playing around, if I were to reduce the rawValue of allowsDownloading to 2, it adds the following capabilities.
Is extending NSFileProviderItemCapabilities not possible or am I doing something wrong?

