Before you continue, please make sure you have a new key for version 2.x. The 1.4.x will not work with 2.x SDK!
Open project and delete the PassioSDKiOS framework
Drag and Drop the new "PassioNutritionAISDK.xcframework" to the project (select copy if needed)
In Projects > Targets > Your App > Frameworks, Libraries, and Embedded Content. Set the "PassioNutritionAISDK.xcframework" to "Embed & Sign"
import PassioSDKiOS
with import PassioNutritionAISDK
PassioSDK.shared
with PassioNutritionAI.shared
detectOCR
with detectPackagedFood
ocrCandidates
with packagedFoodCandidates
fetchPassioIDAttributesFor(ocrcode: $0
with fetchPassioIDAttributesFor(packagedFoodCode: $0.packagedFoodCode)
autoUpdate
with sdkDownloadsModels
isAutoUpdating
with isDownloadingModels
isReadyForNutrition
was removed use isReadyForDetection
The servingSizeQuantity was modified from
to:
The function func searchForFood(byText: String) -> [String]
return value was modified to -> [PassioIDAndName]
.
Removed func lookupPassioIDAttributesFor(name: String) -> PassioIDAttributes?
use instead func searchForFood(byText: String) -> [PassioIDAndName]
and then use the PassioID to lookup the PassioIDAttributes using func lookupPassioIDAttributesFor(passioID: PassioID) -> PassioIDAttributes?
.
the function
was renamed to
where the Bool Returns: UIImage and a bool, The boolean is true if the icons is food icon or false if it's a placeholder icon. If you get false you can use the asycronous funcion to "fetchIconFor" the icons from
Added UIImageView extension please check demo app to check how to use it.
References to logo detection
status.mode == .isReadyForNutrition
use only .isReadyForDetection
all the images from PassioIDAttributes and PassioFoodItemData where removed.
Copyright 2022 Passio Inc
If at any point you need help from the Passio team, please reach out to us at support@passiolife.com