MLKitCommon Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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
Swift
static
let
mlkitModelDownloadDidSucceed
:
NSNotification
.
Name
-
Notification
name for observing model download tasks that fail. The user info dictionary will
contain {ModelDownloadUserInfoKey.remoteModel : RemoteModel}
and {ModelDownloadUserInfoKey.error : NSError}
.
Declaration
Swift
static
let
mlkitModelDownloadDidFail
:
NSNotification
.
Name
-
The key for retrieving the RemoteModel
from the user info dictionary.
-
The key for retrieving the NSError
from the user info dictionary. The corresponding value is nil
if the model download completed successfully.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eGlobally available constants provide notifications for observing model download tasks.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003emlkitModelDownloadDidSucceed\u003c/code\u003e and \u003ccode\u003emlkitModelDownloadDidFail\u003c/code\u003e are notification names for tracking model download success or failure, respectively.\u003c/p\u003e\n"],["\u003cp\u003eUser info dictionaries within these notifications contain details about the \u003ccode\u003eRemoteModel\u003c/code\u003e and potential errors using keys like \u003ccode\u003eremoteModel\u003c/code\u003e and \u003ccode\u003eerror\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# MLKitCommon Framework Reference\n\nConstants\n=========\n\nThe following constants are available globally.\n- `\n ``\n ``\n `\n\n ### [mlkitModelDownloadDidSucceed](#/c:@MLKModelDownloadDidSucceedNotification)\n\n `\n ` \n `Notification` name for observing model download tasks that succeed. The user info dictionary\n will contain `{ModelDownloadUserInfoKey.remoteModel : RemoteModel}`. \n\n #### Declaration\n\n Swift \n\n static let mlkitModelDownloadDidSucceed: NSNotification.Name\n\n- `\n ``\n ``\n `\n\n ### [mlkitModelDownloadDidFail](#/c:@MLKModelDownloadDidFailNotification)\n\n `\n ` \n `Notification` name for observing model download tasks that fail. The user info dictionary will\n contain `{ModelDownloadUserInfoKey.remoteModel : RemoteModel}` and\n `{ModelDownloadUserInfoKey.error : NSError}`. \n\n #### Declaration\n\n Swift \n\n static let mlkitModelDownloadDidFail: NSNotification.Name\n\n- `\n ``\n ``\n `\n\n ### [remoteModel](#/c:@MLKModelDownloadUserInfoKeyRemoteModel)\n\n `\n ` \n The key for retrieving the [RemoteModel](/ml-kit/reference/swift/mlkitcommon/api/reference/Classes/RemoteModel) from the user info dictionary. \n\n #### Declaration\n\n Swift \n\n static let remoteModel: /ml-kit/reference/swift/mlkitcommon/api/reference/Type-Definitions#/c:MLKModelDownloadNotifications.h@T@MLKModelDownloadUserInfoKey\n\n- `\n ``\n ``\n `\n\n ### [error](#/c:@MLKModelDownloadUserInfoKeyError)\n\n `\n ` \n The key for retrieving the `NSError` from the user info dictionary. The corresponding value is\n `nil` if the model download completed successfully. \n\n #### Declaration\n\n Swift \n\n static let error: /ml-kit/reference/swift/mlkitcommon/api/reference/Type-Definitions#/c:MLKModelDownloadNotifications.h@T@MLKModelDownloadUserInfoKey"]]