MLKitCommon Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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.
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."],[[["`MLKModelDownloadConditions` configures conditions for downloading machine learning models."],["It controls whether downloads can occur over cellular networks and in the background."],["Developers can customize these conditions using `initWithAllowsCellularAccess:allowsBackgroundDownloading:` or rely on the defaults with `init`."],["By default, cellular access is allowed (`allowsCellularAccess = YES`), but background downloading is not (`allowsBackgroundDownloading = NO`)."]]],["`MLKModelDownloadConditions` configures model download settings. Key properties include `allowsCellularAccess`, enabling downloads over cellular networks (default: `YES`), and `allowsBackgroundDownloading`, allowing downloads in the background (default: `NO`). You can create instances with custom conditions using `initWithAllowsCellularAccess:allowsBackgroundDownloading:`, or use default settings with `init`. Both methods return a `ModelDownloadConditions` instance.\n"]]