MLKitCommon 架構參考資料
MLKModelDownloadConditions
@interface MLKModelDownloadConditions : NSObject <NSCopying>
模型下載條件的設定。
-
用於指出是否應透過行動網路發出下載要求。預設為 YES
。
聲明
Objective-C
@property (nonatomic, readonly) BOOL allowsCellularAccess;
-
指出模型是否可在應用程式在背景執行時下載。預設為 NO
。
聲明
Objective-C
@property (nonatomic, readonly) BOOL allowsBackgroundDownloading;
-
聲明
Objective-C
- (nonnull instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
allowsBackgroundDownloading:
(BOOL)allowsBackgroundDownloading;
參數
allowsCellularAccess
|
|
allowsBackgroundDownloading
|
|
傳回值
新的 ModelDownloadConditions
執行個體。
-
聲明
Objective-C
- (nonnull instancetype)init;
傳回值
新的 ModelDownloadConditions
執行個體。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-20 (世界標準時間)。
[null,null,["上次更新時間:2024-09-20 (世界標準時間)。"],[[["`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"]]