Contents

knownSparseRanges

A flag indicating that the system should consider the file fully materialized, even if it’s a sparse file.

Declaration

static var knownSparseRanges: NSFileProviderMaterializationFlags { get }

Discussion

There are two reasons why your app may pass a sparse file to the fetchPartialContents(for:version:request:minimalRange:aligningTo:options:completionHandler:) method’s completion handler:

  • You’re deliberately passing just part of the file to the completion handler, and the system should ignore anything outside your retrieved range.

  • The original file contains sparse regions.

This flag tells the system that the original file deliberately has sparse ranges, and that the system can mark the file as materialized without having to request additional information. The system may use this information to optimize its requests, based on the system’s current state.

The system ignores this flag unless the retrieved range passed to the fetchPartialContents(for:version:request:minimalRange:aligningTo:options:completionHandler:) method’s callback handler covers the entire file (a range with a location of zero and a length equal to the file-size in bytes).