Skip to content

Commit 9142d3d

Browse files
Added ReadMe + Minor cleanup
1 parent 6440137 commit 9142d3d

File tree

4 files changed

+37
-17
lines changed

4 files changed

+37
-17
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.10
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
11
# 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.**

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/PassioInternalConnector.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public class PassioInternalConnector {
8585
public func startPassioAppModule(passioExternalConnector: PassioConnector,
8686
presentingViewController: UIViewController,
8787
withViewController: UIViewController,
88-
withDismissAnimation: Bool,
89-
passioConfiguration: PassioConfiguration,
90-
completion: @escaping (PassioStatus) -> Void) {
88+
passioConfiguration: PassioConfiguration) {
9189

9290
self.passioExternalConnector = passioExternalConnector
9391
if PassioNutritionAI.shared.status.mode == .isReadyForDetection {
@@ -103,8 +101,7 @@ public class PassioInternalConnector {
103101
}
104102
}
105103

106-
private func startModule(dismisswithAnimation: Bool = false,
107-
presentingViewController: UIViewController,
104+
private func startModule(presentingViewController: UIViewController,
108105
viewController: UIViewController) {
109106

110107
if let navController = presentingViewController.navigationController {

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/UI/Tabbar/Diary/Diary.storyboard

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<capability name="Named colors" minToolsVersion="9.0"/>
99
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
1010
<capability name="System colors in document resources" minToolsVersion="11.0"/>
11-
<capability name="collection view cell content view" minToolsVersion="11.0"/>
1211
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1312
</dependencies>
1413
<customFonts key="customFonts">
@@ -192,16 +191,7 @@
192191
<size key="footerReferenceSize" width="0.0" height="0.0"/>
193192
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
194193
</collectionViewFlowLayout>
195-
<cells>
196-
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="EkE-Mb-w3Z">
197-
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
198-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
199-
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="UUB-ik-2Ql">
200-
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
201-
<autoresizingMask key="autoresizingMask"/>
202-
</collectionViewCellContentView>
203-
</collectionViewCell>
204-
</cells>
194+
<cells/>
205195
</collectionView>
206196
</subviews>
207197
<color key="backgroundColor" systemColor="systemBackgroundColor"/>

0 commit comments

Comments
 (0)