in ml-functions/MLFunctionsExampleSwift/ViewController.swift [74:88]
func annotateImage(requestData: Dictionary) {
// [START function_annotateImage]
functions.httpsCallable("annotateImage").call(requestData) { (result, error) in
if let error = error as NSError? {
if error.domain == FunctionsErrorDomain {
let code = FunctionsErrorCode(rawValue: error.code)
let message = error.localizedDescription
let details = error.userInfo[FunctionsErrorDetailsKey]
}
// ...
}
// Function completed succesfully
}
// [END function_annotateImage]
}