Справочник по MLKitCommon Framework
MLKModelDownloadConditions
@interface MLKModelDownloadConditions : NSObject <NSCopying>
Конфигурации для условий загрузки модели.
Указывает, следует ли отправлять запросы на загрузку через сотовую сеть. По умолчанию — YES
.
Декларация
Цель-C
@property (nonatomic, readonly) BOOL allowsCellularAccess;
Указывает, можно ли загрузить модель, пока приложение работает в фоновом режиме. Значение по умолчанию — NO
.
Декларация
Цель-C
@property (nonatomic, readonly) BOOL allowsBackgroundDownloading;
Создает новый экземпляр с заданными условиями.
Декларация
Цель-C
- (nonnull instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
allowsBackgroundDownloading:
(BOOL)allowsBackgroundDownloading;
Параметры
allowsCellularAccess | Следует ли отправлять запросы на загрузку через сотовую сеть. |
allowsBackgroundDownloading | Можно ли загрузить модель, пока приложение работает в фоновом режиме. |
Возвращаемое значение
Новый экземпляр ModelDownloadConditions
.
Создает новый экземпляр с условиями по умолчанию. Значения по умолчанию указаны в документации для каждого свойства экземпляра.
Декларация
Цель-C
- (nonnull instancetype)init;
Возвращаемое значение
Новый экземпляр ModelDownloadConditions
.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-01-10 UTC.
[null,null,["Последнее обновление: 2025-01-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"]]