To configure the SDK, we need to provide a key. Obtain your Passio key from the Passio developer portal
Create a new or open your existing project in Xcode and import the framework inside the View Controller
Define reference of SDK inside your View Controller
Configure the SDK using PassioConfiguration
shown in below code. Call configurePassioSDK()
when you need to configure SDK e.g. inside viewDidLoad()
function.
The models required for the SDK to run local recognition can take some time for the first download. If the local recognition is not needed, setting the remoteOnly
to true on the PassioConfiguration process will skip the download of the models. Remote recognition functions like recognizeImageRemote
or searchForFood
will still work.
Implement the PassioStatusDelegate
protocol to receive configuration status updates. While the files are being downloaded, we can show in UI how many files are remanning for the download.
Update the UI based on the configuration status. The isReadyForDetection
status indicated that the SDK is setup successfully and it is ready to use. The implementation of self.askForCapturePermission()
method will be covered in the next section