MLKitCommon Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
ModelDownloadConditions
class ModelDownloadConditions : NSObject, NSCopying
Configurations 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
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.
Return Value
A new ModelDownloadConditions
instance.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`ModelDownloadConditions` configures 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 `ModelDownloadConditions` instance, 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` configures model download settings. It has two key properties: `allowsCellularAccess`, defaulting to `YES`, which dictates if downloads can occur over cellular networks, and `allowsBackgroundDownloading`, defaulting to `NO`, which specifies if downloads can happen in the app's background. A new instance can be initialized using custom conditions for both properties or with default conditions. The methods provided are `init(allowsCellularAccess:allowsBackgroundDownloading:)` for custom conditions and `init()` for default conditions.\n"]]