At the top of your view controller import the PassioNutritionAISDK and AVFoundation
importPassioNutritionAISDKimportAVFoundation
Add the following properties to your view controller.
let passioSDK = PassioNutritionAI.sharedvar videoLayer: AVCaptureVideoPreviewLayer?
In viewDidLoad configure the SDK with the Key you have received form Passio.
overridefuncviewDidLoad() { super.viewDidLoad()let key ="Your_PassioSDK_Key"//* Use the API key you received from us or request a key from [support@passiolife.com](support@passiolife.com).let passioConfig =PassioConfiguration(key: key) passioSDK.configure(passioConfiguration: passioConfig) { (status) inprint("Mode = \(status.mode)\nmissingfiles = \(String(describing: status.missingFiles))") }}
You will receive the PassioStatus back from the SDK.
publicstructPassioStatus {publicinternal(set)var mode: PassioSDK.PassioMode { get }publicinternal(set)var missingFiles: [PassioSDK.FileName]? { get }publicinternal(set)var debugMessage: String? { get }publicinternal(set)var activeModels: Int? { get }}publicenumPassioMode {case notReadycase isBeingConfiguredcase isDownloadingModelscase isReadyForDetectioncase failedToConfigure}
If at any point you need help from the Passio team, please reach out to us at support@passiolife.com