MLKitCommon Framework Reference

  • Globally available constants provide notifications for observing model download successes and failures.

  • MLKModelDownloadDidSucceedNotification and MLKModelDownloadDidFailNotification are the notification names for observing model download tasks.

  • The user info dictionary provides access to the RemoteModel and potential errors using keys MLKModelDownloadUserInfoKeyRemoteModel and MLKModelDownloadUserInfoKeyError respectively.

Constants

The following constants are available globally.

  • Notification name for observing model download tasks that succeed. The user info dictionary will contain {ModelDownloadUserInfoKey.remoteModel : RemoteModel} .

    Declaration

    Objective-C

      extern 
     NS_SWIFT_NAME 
     ( 
     mlkitModelDownloadDidSucceed 
     ) 
     const 
     NSNotificationName 
     MLKModelDownloadDidSucceedNotification 
     
    
  • Notification name for observing model download tasks that fail. The user info dictionary will contain {ModelDownloadUserInfoKey.remoteModel : RemoteModel} and {ModelDownloadUserInfoKey.error : NSError} .

    Declaration

    Objective-C

      extern 
     NS_SWIFT_NAME 
     ( 
     mlkitModelDownloadDidFail 
     ) 
     const 
     NSNotificationName 
     MLKModelDownloadDidFailNotification 
     
    
  • The key for retrieving the RemoteModel from the user info dictionary.

    Declaration

    Objective-C

      extern 
     const 
      MLKModelDownloadUserInfoKey 
     
     _Nonnull 
     MLKModelDownloadUserInfoKeyRemoteModel 
     
    
  • The key for retrieving the NSError from the user info dictionary. The corresponding value is nil if the model download completed successfully.

    Declaration

    Objective-C

      extern 
     const 
      MLKModelDownloadUserInfoKey 
     
     _Nonnull 
     MLKModelDownloadUserInfoKeyError 
     
    
Design a Mobile Site
View Site in Mobile | Classic
Share by: