Skip to content

Commit aa11366

Browse files
authored
Merge pull request #40 from Passiolife/bugfix/update-favourite-tint-color
Bug fixes & enhancements:
2 parents 55969c5 + 354d032 commit aa11366

File tree

15 files changed

+95
-150
lines changed

15 files changed

+95
-150
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
dependencies: [
1919
// Dependencies declare other packages that this package depends on.
2020
// .package(url: "https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution",
21-
// .upToNextMajor(from: "3.0.0")),
21+
// exact: "3.2.1"),
2222
.package(url: "https://github.com/SwipeCellKit/SwipeCellKit",
2323
.upToNextMajor(from: "2.7.1")),
2424
.package(url: "https://github.com/WenchaoD/FSCalendar.git",

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/CoreData/CoreDataUtils/CoreDataManager.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ class CoreDataManager {
2828

2929
// Get the documents directory URL
3030
guard let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first else {
31-
passioLog(message: "Could not find the documents directory.")
31+
print( "Could not find the documents directory.")
3232
return
3333
}
3434

3535
let destinationURL = documentsDirectory.appendingPathComponent("\(fileName).\(fileExtension)")
3636

3737
// Check if the file already exists
3838
if fileManager.fileExists(atPath: destinationURL.path) {
39-
passioLog(message: "File already exists at path: \(destinationURL.path)")
39+
print( "File already exists at path: \(destinationURL.path)")
4040
return
4141
}
4242

4343
// Get the source URL for the file in the package resources
4444

4545
guard let sourceURL = Bundle.module.url(forResource: fileName, withExtension: "momd") else {
46-
passioLog(message: "File not found in package resources.")
46+
print( "File not found in package resources.")
4747
return
4848
}
4949

5050
do {
5151
// Copy the file
5252
try fileManager.copyItem(at: sourceURL, to: destinationURL)
53-
passioLog(message: "File copied to: \(destinationURL.path)")
53+
print( "File copied to: \(destinationURL.path)")
5454
} catch {
55-
passioLog(message: "Error copying file: \(error)")
55+
print( "Error copying file: \(error)")
5656
}
5757
}
5858

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/CoreData/CoreDataUtils/ExtensionNSManagedObject.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extension NSManagedObject {
8181
do { return try context.fetch(fRequest).last as? NSManagedObject }
8282

8383
catch {
84-
passioLog(message: "Error while finding the NSManagedObject with dict :-(dict) AND error is :- (error.localizedDescription)")
84+
print( "Error while finding the NSManagedObject with dict :-(dict) AND error is :- (error.localizedDescription)")
8585
}
8686
return nil
8787
}
@@ -117,7 +117,7 @@ extension NSManagedObject {
117117
do { return try mainManagedObjectContext.fetch(fRequest) as? [NSManagedObject] }
118118

119119
catch {
120-
passioLog(message: "Error while fetching the NSManagedObjects with dict :- \(predicate ?? NSPredicate()) , sortDescriptor :- \(sortDescriptor ?? [NSSortDescriptor()]) AND error is :- \(error.localizedDescription)")
120+
print( "Error while fetching the NSManagedObjects with dict :- \(predicate ?? NSPredicate()) , sortDescriptor :- \(sortDescriptor ?? [NSSortDescriptor()]) AND error is :- \(error.localizedDescription)")
121121
}
122122
return nil
123123
}
@@ -127,7 +127,7 @@ extension NSManagedObject {
127127
do { return try mainManagedObjectContext.fetch(fetchRequest)}
128128

129129
catch {
130-
passioLog(message: "Error while fetching all NSManagedObjects from entity\(entityName) :- \(error.localizedDescription)")
130+
print( "Error while fetching all NSManagedObjects from entity\(entityName) :- \(error.localizedDescription)")
131131
}
132132
return nil
133133
}
@@ -155,7 +155,7 @@ extension NSManagedObject {
155155
}
156156

157157
} catch {
158-
passioLog(message: "Error while updating the NSManagedObjects with dict :- \(dict) , predicate :- \(predicate ?? NSPredicate()) AND error is :- \(error.localizedDescription)")
158+
print( "Error while updating the NSManagedObjects with dict :- \(dict) , predicate :- \(predicate ?? NSPredicate()) AND error is :- \(error.localizedDescription)")
159159
}
160160
}
161161
}
@@ -185,7 +185,7 @@ extension NSManagedObject {
185185
managedObjectContext.reset()
186186
}
187187
catch {
188-
passioLog(message: "Error while delete all NSManagedObjects with predicate :- \(predicate) AND error is :- \(error.localizedDescription)")
188+
print( "Error while delete all NSManagedObjects with predicate :- \(predicate) AND error is :- \(error.localizedDescription)")
189189
}
190190
}
191191

@@ -201,7 +201,7 @@ extension NSManagedObject {
201201
managedObjectContext.reset()
202202
}
203203
catch {
204-
passioLog(message: "Error while delete all NSManagedObjects AND error is :- \(error.localizedDescription)")
204+
print( "Error while delete all NSManagedObjects AND error is :- \(error.localizedDescription)")
205205
}
206206
}
207207
}

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/CoreData/CoreDataUtils/ExtesionNSManagedObjectContext.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extension NSManagedObjectContext {
1313
try save()
1414
}
1515
catch {
16-
passioLog(message: "Error while saving the Single Change into NSManagedObjectContext :- \(error.localizedDescription)")
16+
print( "Error while saving the Single Change into NSManagedObjectContext :- \(error.localizedDescription)")
1717
}
1818
}
1919
}
@@ -31,7 +31,7 @@ extension NSManagedObjectContext {
3131
self.saveChangesOnMediatorContext(mediatorMangedObjectContext: mediatorMangedObjectContext, privateManagedObjectContext: privateManagedObjectContext)
3232
}
3333
catch {
34-
passioLog(message: "Error while saving the Changes into ChildNSManagedObjectContext :- (error.localizedDescription)")
34+
print( "Error while saving the Changes into ChildNSManagedObjectContext :- (error.localizedDescription)")
3535
}
3636
}
3737
}
@@ -45,7 +45,7 @@ extension NSManagedObjectContext {
4545
self.saveChangesOnPrivateContext(privateManagedObjectContext: privateManagedObjectContext)
4646
}
4747
catch {
48-
passioLog(message: "Error while saving the Changes into MediatorNSManagedObjectContext :- (error.localizedDescription)")
48+
print( "Error while saving the Changes into MediatorNSManagedObjectContext :- (error.localizedDescription)")
4949
}
5050
}
5151
}
@@ -59,7 +59,7 @@ extension NSManagedObjectContext {
5959
try privateManagedObjectContext.save()
6060
}
6161
catch {
62-
passioLog(message: "Error while saving the Changes into PrivateNSManagedObjectContext :- (error.localizedDescription)")
62+
print( "Error while saving the Changes into PrivateNSManagedObjectContext :- (error.localizedDescription)")
6363
}
6464
}
6565
}

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/CoreData/Model/CustomFoodRecordOperations.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ internal class CustomFoodRecordOperations {
106106

107107
} catch let error {
108108

109-
passioLog(message: "Failed to fetch match delete and save as new Custom recored: \(error)")
109+
print( "Failed to fetch match delete and save as new Custom recored: \(error)")
110110

111111
mainContext.saveChanges()
112112
completion(false, error)
@@ -134,11 +134,11 @@ internal class CustomFoodRecordOperations {
134134

135135
if let firstRecord = results.first {
136136
dbFoodRecordV3 = firstRecord
137-
passioLog(message: "Existing Custom Record found to update")
137+
print( "Existing Custom Record found to update")
138138
}
139139
else {
140140
dbFoodRecordV3 = TblCustomFoodRecord(context: mainContext)
141-
passioLog(message: "New Custom Record is created for storage")
141+
print( "New Custom Record is created for storage")
142142
}
143143

144144
guard let dbFoodRecordV3 = dbFoodRecordV3 else {
@@ -223,7 +223,7 @@ internal class CustomFoodRecordOperations {
223223

224224
} catch let error {
225225

226-
passioLog(message: "Failed to fetch match and save as new Custom recored: \(error)")
226+
print( "Failed to fetch match and save as new Custom recored: \(error)")
227227

228228
mainContext.saveChanges()
229229
completion(false, error)
@@ -256,11 +256,11 @@ internal class CustomFoodRecordOperations {
256256

257257
if let firstRecord = results.first {
258258
dbFoodRecordV3 = firstRecord
259-
passioLog(message: "Existing Custom Record found to update")
259+
print( "Existing Custom Record found to update")
260260
}
261261
else {
262262
dbFoodRecordV3 = TblCustomFoodRecord(context: mainContext)
263-
passioLog(message: "New Custom Record is created for storage")
263+
print( "New Custom Record is created for storage")
264264
}
265265

266266
guard let dbFoodRecordV3 = dbFoodRecordV3 else {
@@ -341,7 +341,7 @@ internal class CustomFoodRecordOperations {
341341

342342
} catch let error {
343343
errorStatement = error
344-
passioLog(message: "Failed to fetch match and save as new Custom recored: \(error)")
344+
print( "Failed to fetch match and save as new Custom recored: \(error)")
345345
}
346346

347347
}
@@ -376,7 +376,7 @@ internal class CustomFoodRecordOperations {
376376
let results = try mainContext.fetch(fetchRequest)
377377

378378
if let firstRecord = results.first {
379-
passioLog(message: "Existing Custom Record found for storage and will update it")
379+
print( "Existing Custom Record found for storage and will update it")
380380
dbFoodRecordV3 = firstRecord
381381

382382
guard let dbFoodRecordV3 = dbFoodRecordV3 else { return }
@@ -446,7 +446,7 @@ internal class CustomFoodRecordOperations {
446446
}
447447
} catch let error {
448448

449-
passioLog(message: "Failed to fetch Custom record to update: \(error)")
449+
print( "Failed to fetch Custom record to update: \(error)")
450450

451451
mainContext.saveChanges()
452452
completion(false, error)
@@ -478,7 +478,7 @@ internal class CustomFoodRecordOperations {
478478

479479
} catch let error {
480480

481-
passioLog(message: "Failed to fetch Custom records: \(error)")
481+
print( "Failed to fetch Custom records: \(error)")
482482

483483
mainContext.saveChanges()
484484
completion([], error)
@@ -512,7 +512,7 @@ internal class CustomFoodRecordOperations {
512512

513513
} catch let error {
514514

515-
passioLog(message: "Failed to fetch Custom records: \(error)")
515+
print( "Failed to fetch Custom records: \(error)")
516516

517517
mainContext.saveChanges()
518518
completion([], error)
@@ -546,7 +546,7 @@ internal class CustomFoodRecordOperations {
546546

547547
} catch let error {
548548

549-
passioLog(message: "Failed to fetch Custom records: \(error)")
549+
print( "Failed to fetch Custom records: \(error)")
550550

551551
mainContext.saveChanges()
552552
completion([], error)
@@ -580,7 +580,7 @@ internal class CustomFoodRecordOperations {
580580

581581
} catch let error {
582582

583-
passioLog(message: "Failed to fetch Custom records: \(error)")
583+
print( "Failed to fetch Custom records: \(error)")
584584

585585
mainContext.saveChanges()
586586
completion([], error)
@@ -614,7 +614,7 @@ internal class CustomFoodRecordOperations {
614614

615615
} catch let error {
616616

617-
passioLog(message: "Failed to fetch Custom record to delete: \(error)")
617+
print( "Failed to fetch Custom record to delete: \(error)")
618618

619619
mainContext.saveChanges()
620620
completion(false, error)
@@ -649,7 +649,7 @@ internal class CustomFoodRecordOperations {
649649

650650
} catch let error {
651651

652-
passioLog(message: "Failed to fetch Custom record to delete: \(error)")
652+
print( "Failed to fetch Custom record to delete: \(error)")
653653

654654
mainContext.saveChanges()
655655
completion(false, error)

Sources/PassioNutritionUIModule/NutritionUIModule/NutritionUI/CoreData/Model/FavouriteFoodRecordOperations.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ internal class FavouriteFoodRecordOperations {
106106

107107
} catch let error {
108108

109-
passioLog(message: "Failed to fetch match delete and save as new Favourite recored: \(error)")
109+
print( "Failed to fetch match delete and save as new Favourite recored: \(error)")
110110

111111
mainContext.saveChanges()
112112
completion(false, error)
@@ -134,11 +134,11 @@ internal class FavouriteFoodRecordOperations {
134134

135135
if let firstRecord = results.first {
136136
dbFoodRecordV3 = firstRecord
137-
passioLog(message: "Existing Favourite Record found to update")
137+
print( "Existing Favourite Record found to update")
138138
}
139139
else {
140140
dbFoodRecordV3 = TblFavouriteFoodRecord(context: mainContext)
141-
passioLog(message: "New Favourite Record is created for storage")
141+
print( "New Favourite Record is created for storage")
142142
}
143143

144144
guard let dbFoodRecordV3 = dbFoodRecordV3 else {
@@ -223,7 +223,7 @@ internal class FavouriteFoodRecordOperations {
223223

224224
} catch let error {
225225

226-
passioLog(message: "Failed to fetch match and save as new Favourite recored: \(error)")
226+
print( "Failed to fetch match and save as new Favourite recored: \(error)")
227227

228228
mainContext.saveChanges()
229229
completion(false, error)
@@ -254,11 +254,11 @@ internal class FavouriteFoodRecordOperations {
254254

255255
if let firstRecord = results.first {
256256
dbFoodRecordV3 = firstRecord
257-
passioLog(message: "Existing Favourite Record found to update")
257+
print( "Existing Favourite Record found to update")
258258
}
259259
else {
260260
dbFoodRecordV3 = TblFavouriteFoodRecord(context: mainContext)
261-
passioLog(message: "New Favourite Record is created for storage")
261+
print( "New Favourite Record is created for storage")
262262
}
263263

264264
guard let dbFoodRecordV3 = dbFoodRecordV3 else {
@@ -340,7 +340,7 @@ internal class FavouriteFoodRecordOperations {
340340

341341
} catch let error {
342342
errorStatement = error
343-
passioLog(message: "Failed to fetch match and save as new Favourite recored: \(error)")
343+
print( "Failed to fetch match and save as new Favourite recored: \(error)")
344344
completion(false, error)
345345
}
346346

@@ -375,7 +375,7 @@ internal class FavouriteFoodRecordOperations {
375375
let results = try mainContext.fetch(fetchRequest)
376376

377377
if let firstRecord = results.first {
378-
passioLog(message: "Existing Favourite Record found for storage and will update it")
378+
print( "Existing Favourite Record found for storage and will update it")
379379
dbFoodRecordV3 = firstRecord
380380

381381
guard let dbFoodRecordV3 = dbFoodRecordV3 else { return }
@@ -444,7 +444,7 @@ internal class FavouriteFoodRecordOperations {
444444
completion(true, nil)
445445
}
446446
} catch let error {
447-
passioLog(message: "Failed to fetch Favourite record to update: \(error)")
447+
print( "Failed to fetch Favourite record to update: \(error)")
448448

449449
mainContext.saveChanges()
450450
completion(false, error)
@@ -476,7 +476,7 @@ internal class FavouriteFoodRecordOperations {
476476

477477
} catch let error {
478478

479-
passioLog(message: "Failed to fetch Favourite records: \(error)")
479+
print( "Failed to fetch Favourite records: \(error)")
480480

481481
mainContext.saveChanges()
482482
completion([], error)
@@ -510,7 +510,7 @@ internal class FavouriteFoodRecordOperations {
510510

511511
} catch let error {
512512

513-
passioLog(message: "Failed to fetch Favourite records: \(error)")
513+
print( "Failed to fetch Favourite records: \(error)")
514514

515515
mainContext.saveChanges()
516516
completion([], error)
@@ -544,7 +544,7 @@ internal class FavouriteFoodRecordOperations {
544544

545545
} catch let error {
546546

547-
passioLog(message: "Failed to fetch Favourite records: \(error)")
547+
print( "Failed to fetch Favourite records: \(error)")
548548

549549
mainContext.saveChanges()
550550
completion([], error)
@@ -578,7 +578,7 @@ internal class FavouriteFoodRecordOperations {
578578

579579
} catch let error {
580580

581-
passioLog(message: "Failed to fetch Favourite records: \(error)")
581+
print( "Failed to fetch Favourite records: \(error)")
582582

583583
mainContext.saveChanges()
584584
completion([], error)
@@ -612,7 +612,7 @@ internal class FavouriteFoodRecordOperations {
612612

613613
} catch let error {
614614

615-
passioLog(message: "Failed to fetch Favourite record to delete: \(error)")
615+
print( "Failed to fetch Favourite record to delete: \(error)")
616616

617617
mainContext.saveChanges()
618618
completion(false, error)
@@ -647,7 +647,7 @@ internal class FavouriteFoodRecordOperations {
647647

648648
} catch let error {
649649

650-
passioLog(message: "Failed to fetch record to delete: \(error)")
650+
print( "Failed to fetch record to delete: \(error)")
651651

652652
mainContext.saveChanges()
653653
completion(false, error)

0 commit comments

Comments
 (0)