Page Summary
-
Globally available type definitions include
TranslateLanguage,TranslatorDownloadModelIfNeededCallback, andTranslatorCallback. -
TranslateLanguagespecifies the languages supported by the Translator. -
TranslatorDownloadModelIfNeededCallbackis invoked after the download of translate models, indicating success or failure with an error. -
TranslatorCallbackprovides the translation result or an error upon completion.
Type Definitions
The following type definitions are available globally.
-
This enum specifies the languages that are supported by
Translator.Declaration
Swift
struct TranslateLanguage : _ObjectiveCBridgeable , Hashable , Equatable , _SwiftNewtypeWrapper , RawRepresentable -
A block that is invoked when the downloading of translate models is complete.
Declaration
Swift
typealias TranslatorDownloadModelIfNeededCallback = ( Error ?) -> VoidParameters
errorThe error or
nil. -
A block containing the translation result or
nilif there’s an error.Declaration
Swift
typealias TranslatorCallback = ( String ?, Error ?) -> VoidParameters
resultA translation result for the text or
nilif there’s an error.errorThe error or
nil.


