AI-generated Key Takeaways
-
MLKTranslateRemoteModelis a translation model stored on a server and downloaded to the device for use. -
It is associated with a specific language, accessible via the
languageproperty. -
Instances should be created using
translateRemoteModelWithLanguage:, specifying the desired language. -
Downloading the model triggers a
RemoteModelnotification, verifiable through theModelDownloadUserInfoKeyRemoteModelfield. -
Direct initialization with
initis not allowed; use the provided factory method instead.
MLKTranslateRemoteModel
@interface MLKTranslateRemoteModel : MLKRemoteModelA translate model that is stored remotely on the server and downloaded on the device.
-
The language associated with this model.
Declaration
Objective-C
@property (nonatomic, readonly) MLKTranslateLanguage _Nonnull language; -
Gets an instance of
TranslateRemoteModelconfigured with the given language. This model can be used to trigger a download by callingdownload(_:)API fromModelManager.TranslateRemoteModelusesModelManagerinternally. When downloading aTranslateRemoteModel, there will be a notification posted for aRemoteModel. To verify if such notifications belong to aTranslateRemoteModel, check that theModelDownloadUserInfoKeyRemoteModelfield in the user info dictionary contains an object of typeTranslateRemoteModel. Please do not instantiate withTranslateLanguage.englishgiven it is built-in. Otherwise such instance cannot be downloaded or deleted.Declaration
Objective-C
+ (nonnull MLKTranslateRemoteModel *)translateRemoteModelWithLanguage: (nonnull MLKTranslateLanguage)language;Parameters
languageThe given language.
Return Value
A
TranslateRemoteModelinstance. -
Unavailable. Use
translateRemoteModel(language:)instead.Declaration
Objective-C
- (nonnull instancetype)init;