|
1 | 1 | # Passio-Nutrition-AI-iOS-UI-Module-Distribution |
| 2 | + |
| 3 | +### 1. Add PassioNutritionUIModule as a Swift Package for Xcode 15 or newer |
| 4 | +***Note:*** Please remove `PassioNutritionAISDK` from the project if you have already added it as a Swift Package. You don't need to add `PassioNutritionAISDK` because it is already included in PassioNutritionUIModule's dependencies. The UI Module and SDK are included in the `PassioNutritionUIModule` SPM as a Swift Package. |
| 5 | +1. Open your Xcode project. |
| 6 | +2. Go to File > Swift Packages > Add Package Dependency. |
| 7 | +3. In the "Add Package Dependency" dialog box, paste the URL: [https://github.com/Passiolife/Passio-Nutrition-AI-iOS-UI-Module-Distribution](https://github.com/Passiolife/Passio-Nutrition-AI-iOS-UI-Module-Distribution) |
| 8 | +4. In Dependency Rule select `upToNextMajorVersion` and set it to `1.0.0`. |
| 9 | +5. After you've made your selection, click "Add Package". |
| 10 | +6. You'll then be prompted to select the targets in your project that should include the package. Check the boxes for the targets you want to include and click "Add Package". |
| 11 | +7. The PassioNutritionUIModule and PassioNutritionAISDK, together with any additional dependencies required by PassioNutritionUIModule, will be downloaded and added to your project by Xcode. Now that you have the PassioNutritionUIModule imported, you may use it. |
| 12 | + |
| 13 | +### 2. Set entry point for PassioNutritionUIModule to your current Xcode Project. |
| 14 | +***Note:*** Please click this link https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution to learn how to configure `PassioNutritionAISDK` if you haven't already. |
| 15 | + |
| 16 | +1. `import PassioNutritionUIModule` into the ViewController that you wish to designate as the PassioNutritionUIModule entry point. |
| 17 | +2. Call the 'startPassioAppModule' method of the 'PassioInternalConnector' class with a shared instance on UIButton's @IBAction or on any other function as per your requirement. |
| 18 | + ```swift |
| 19 | + // Set navigationBar as per your app |
| 20 | + navigationController?.navigationBar.isHidden = false |
| 21 | + // Instantiate HomeTabBar Controller (Passio's Nutrition UI module) |
| 22 | + let vc = NutriationUICoordinator.getHomeTabbarViewController() |
| 23 | + // Use this method to navigate to Passio's Nutrition UI module |
| 24 | + PassioInternalConnector.shared.startPassioAppModule(passioExternalConnector: passioExternalConnector, |
| 25 | + presentingViewController: self, |
| 26 | + withViewController: vc |
| 27 | + passioConfiguration: passioConfig) |
| 28 | + ``` |
| 29 | +After completing the steps above, you should be able to navigate to `PassioNutritionUIModule`. |
| 30 | +
|
| 31 | +***Note:*** Make sure to add `<key>>NSCameraUsageDescription</key><string>For real-time food recognition</string>`. in your Info.plist if you haven't already. |
| 32 | +
|
| 33 | +<br></br> |
| 34 | +**© 2024 Passio, Inc. All rights reserved.** |
0 commit comments