Migration from SDK 1.4.X to 2.x
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!
Remove SDK 1.4.x
Open project and delete the PassioSDKiOS framework
Add the new SDK 2.x
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"
Find and Replace all
import PassioSDKiOS
withimport PassioNutritionAISDK
PassioSDK.shared
withPassioNutritionAI.shared
detectOCR
withdetectPackagedFood
ocrCandidates
withpackagedFoodCandidates
fetchPassioIDAttributesFor(ocrcode: $0
withfetchPassioIDAttributesFor(packagedFoodCode: $0.packagedFoodCode)
autoUpdate
withsdkDownloadsModels
isAutoUpdating
withisDownloadingModels
isReadyForNutrition
was removed useisReadyForDetection
The servingSizeQuantity was modified from
to:
Changes to the functions
The function
func searchForFood(byText: String) -> [String]
return value was modified to-> [PassioIDAndName]
.Removed
func lookupPassioIDAttributesFor(name: String) -> PassioIDAttributes?
use insteadfunc searchForFood(byText: String) -> [PassioIDAndName]
and then use the PassioID to lookup the PassioIDAttributes usingfunc 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.
Removed from the SDK
References to logo detection
status.mode == .isReadyForNutrition
use only.isReadyForDetection
all the images from PassioIDAttributes and PassioFoodItemData where removed.
PassioDownloadDelegate was merged into the PassioStatusDelegate
Copyright 2022 Passio Inc
If at any point you need help from the Passio team, please reach out to us at support@passiolife.com
Last updated