Skip to content

Ability to exclude iOS downloads from backup #141

Description

@markst

Downloads are backed up to iCloud, does it make sense to add the ability to exclude certain downloads from backing up?

extension URL {
    /// Sets the `isExcludedFromBackupKey` to `true` to prevent the resource from being backed up to iCloud.
    @discardableResult
    mutating func excludeFromBackup() throws -> URL {
        var resourceValues = URLResourceValues()
        resourceValues.isExcludedFromBackup = true
        try self.setResourceValues(resourceValues)
        return self
    }
}

https://developer.apple.com/documentation/foundation/urlresourcevalues/isexcludedfrombackup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions