MLKitCommon Framework Reference

MLKModelDownloadConditions


@interface MLKModelDownloadConditions : NSObject <NSCopying>

Configurations for model downloading conditions.

  • Indicates whether download requests should be made over a cellular network. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL allowsCellularAccess;
  • Indicates whether the model can be downloaded while the app is in the background. The default is NO.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL allowsBackgroundDownloading;
  • Creates a new instance with the given conditions.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
                             allowsBackgroundDownloading:
                                 (BOOL)allowsBackgroundDownloading;

    Parameters

    allowsCellularAccess

    Whether download requests should be made over a cellular network.

    allowsBackgroundDownloading

    Whether the model can be downloaded while the app is in the background.

    Return Value

    A new ModelDownloadConditions instance.

  • Creates a new instance with the default conditions. The default values are specified in the documentation for each instance property.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Return Value

    A new ModelDownloadConditions instance.