MLKitTranslate Framework Reference

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?) -> Void

    Parameters

    error

    The error or nil.

  • A block containing the translation result or nil if there’s an error.

    Declaration

    Swift

    typealias TranslatorCallback = (String?, Error?) -> Void

    Parameters

    result

    A translation result for the text or nil if there’s an error.

    error

    The error or nil.