MLKitCommon 架構參考資料

常數

下列常數可在全球使用。

  • Notification 名稱,用於觀察成功的模型下載工作。使用者資訊字典會包含 {ModelDownloadUserInfoKey.remoteModel : RemoteModel}

    聲明

    Objective-C

    extern NS_SWIFT_NAME(mlkitModelDownloadDidSucceed) const NSNotificationName
        MLKModelDownloadDidSucceedNotification
  • Notification 名稱,用於觀察失敗的模型下載工作。使用者資訊字典會包含 {ModelDownloadUserInfoKey.remoteModel : RemoteModel}{ModelDownloadUserInfoKey.error : NSError}

    聲明

    Objective-C

    extern NS_SWIFT_NAME(mlkitModelDownloadDidFail) const NSNotificationName
        MLKModelDownloadDidFailNotification
  • 從使用者資訊字典擷取 RemoteModel 的金鑰。

    聲明

    Objective-C

    extern const MLKModelDownloadUserInfoKey _Nonnull MLKModelDownloadUserInfoKeyRemoteModel
  • 從使用者資訊字典擷取 NSError 的金鑰。如果模型下載成功,對應的值會是 nil

    聲明

    Objective-C

    extern const MLKModelDownloadUserInfoKey _Nonnull MLKModelDownloadUserInfoKeyError