Page Summary
-
ModelDownloadConditionsconfigures how a machine learning model is downloaded, including network and background preferences. -
By default, models can be downloaded over cellular networks but not in the background.
-
You can customize these settings when creating a
ModelDownloadConditionsinstance, specifying whether to allow cellular access and background downloading. -
The
init()initializer creates an instance with default settings, while the designated initializer lets you customize the download conditions.
ModelDownloadConditions
class ModelDownloadConditions : NSObject, NSCopyingConfigurations for model downloading conditions.
-
Indicates whether download requests should be made over a cellular network. The default is
YES.Declaration
Swift
var allowsCellularAccess: Bool { get } -
Indicates whether the model can be downloaded while the app is in the background. The default is
NO.Declaration
Swift
var allowsBackgroundDownloading: Bool { get } -
Creates a new instance with the given conditions.
Declaration
Swift
init(allowsCellularAccess: Bool, allowsBackgroundDownloading: Bool)Parameters
allowsCellularAccessWhether download requests should be made over a cellular network.
allowsBackgroundDownloadingWhether the model can be downloaded while the app is in the background.
Return Value
A new
ModelDownloadConditionsinstance. -
Creates a new instance with the default conditions. The default values are specified in the documentation for each instance property.
Declaration
Swift
convenience init()Return Value
A new
ModelDownloadConditionsinstance.