diff --git a/Healthy.xcodeproj/project.pbxproj b/Healthy.xcodeproj/project.pbxproj index 71515ab4..a05c42b9 100644 --- a/Healthy.xcodeproj/project.pbxproj +++ b/Healthy.xcodeproj/project.pbxproj @@ -42,7 +42,6 @@ 025511D52A3D0A8B00295B91 /* CreateAccountviewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025511CD2A3D0A8B00295B91 /* CreateAccountviewModelType.swift */; }; 025511D62A3D0A8B00295B91 /* CreateAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025511CE2A3D0A8B00295B91 /* CreateAccountViewController.swift */; }; 025A47532A336B05008BF85A /* DashboardViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025A474F2A336B05008BF85A /* DashboardViewModelType.swift */; }; - 025A47542A336B05008BF85A /* DashboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025A47502A336B05008BF85A /* DashboardViewController.swift */; }; 025A47552A336B05008BF85A /* DashboardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025A47512A336B05008BF85A /* DashboardViewModel.swift */; }; 025A47562A336B05008BF85A /* DashboardViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 025A47522A336B05008BF85A /* DashboardViewController.xib */; }; 025A47592A336C2D008BF85A /* HomeHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025A47582A336C2D008BF85A /* HomeHeaderView.swift */; }; @@ -124,10 +123,16 @@ B241608B2A45B4DA000DF5BA /* FoodTagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B24160872A45B4DA000DF5BA /* FoodTagCollectionViewCell.swift */; }; B241608C2A45B4DA000DF5BA /* FoodTagCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B24160882A45B4DA000DF5BA /* FoodTagCollectionViewCell.xib */; }; B29ABA5C2A3469CA00171A0C /* MainTapBarControllerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B29ABA5B2A3469CA00171A0C /* MainTapBarControllerTest.swift */; }; + B2AE66652A6F283B00937D29 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2AE66632A6F283B00937D29 /* HeaderView.swift */; }; + B2CA7C8B2A6F026D005C5993 /* DashboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2CA7C8A2A6F026D005C5993 /* DashboardViewController.swift */; }; B2D402D82A3BA9F600FDB941 /* UIFont+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2D402D72A3BA9F600FDB941 /* UIFont+Style.swift */; }; B2D402DF2A3BB1D700FDB941 /* UILabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2D402DE2A3BB1D700FDB941 /* UILabelStyle.swift */; }; B2D402E52A3BB30B00FDB941 /* UILabelStyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2D402E42A3BB30B00FDB941 /* UILabelStyleTests.swift */; }; B2E577432A40A52900FEFD05 /* SearchCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2E577412A40A52900FEFD05 /* SearchCollectionViewCell.xib */; }; + B2F0CF132A6EEFFA0015CBF5 /* SearchBarWithFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2F0CF122A6EEFFA0015CBF5 /* SearchBarWithFilterView.swift */; }; + B2F0CF172A6EF0310015CBF5 /* SearchBarWithFilterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2F0CF162A6EF0310015CBF5 /* SearchBarWithFilterView.xib */; }; + B2F0CF192A6EF15F0015CBF5 /* NewRecipesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2F0CF182A6EF15F0015CBF5 /* NewRecipesView.swift */; }; + B2F0CF1B2A6EF16E0015CBF5 /* NewRecipesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2F0CF1A2A6EF16E0015CBF5 /* NewRecipesView.xib */; }; B2F799E42A34459B002F1894 /* MainTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2F799E32A34459B002F1894 /* MainTabBar.swift */; }; B2F799E92A344B9A002F1894 /* MainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2F799E82A344B9A002F1894 /* MainTabBarController.swift */; }; B85D26A72A3902DF000A463D /* EmailValidatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85D26A62A3902DF000A463D /* EmailValidatorsTests.swift */; }; @@ -194,7 +199,6 @@ 025511CD2A3D0A8B00295B91 /* CreateAccountviewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateAccountviewModelType.swift; sourceTree = ""; }; 025511CE2A3D0A8B00295B91 /* CreateAccountViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateAccountViewController.swift; sourceTree = ""; }; 025A474F2A336B05008BF85A /* DashboardViewModelType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardViewModelType.swift; sourceTree = ""; }; - 025A47502A336B05008BF85A /* DashboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardViewController.swift; sourceTree = ""; }; 025A47512A336B05008BF85A /* DashboardViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardViewModel.swift; sourceTree = ""; }; 025A47522A336B05008BF85A /* DashboardViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DashboardViewController.xib; sourceTree = ""; }; 025A47582A336C2D008BF85A /* HomeHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeHeaderView.swift; sourceTree = ""; }; @@ -275,11 +279,17 @@ B24160872A45B4DA000DF5BA /* FoodTagCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FoodTagCollectionViewCell.swift; sourceTree = ""; }; B24160882A45B4DA000DF5BA /* FoodTagCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FoodTagCollectionViewCell.xib; sourceTree = ""; }; B29ABA5B2A3469CA00171A0C /* MainTapBarControllerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainTapBarControllerTest.swift; sourceTree = ""; }; + B2AE66632A6F283B00937D29 /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; + B2CA7C8A2A6F026D005C5993 /* DashboardViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DashboardViewController.swift; sourceTree = ""; }; B2D402D72A3BA9F600FDB941 /* UIFont+Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIFont+Style.swift"; sourceTree = ""; }; B2D402DE2A3BB1D700FDB941 /* UILabelStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UILabelStyle.swift; sourceTree = ""; }; B2D402E02A3BB1F000FDB941 /* UIFont+Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIFont+Style.swift"; path = "Healthy/Classes/Extensions/UIFont+Style.swift"; sourceTree = SOURCE_ROOT; }; B2D402E42A3BB30B00FDB941 /* UILabelStyleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UILabelStyleTests.swift; sourceTree = ""; }; B2E577412A40A52900FEFD05 /* SearchCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SearchCollectionViewCell.xib; sourceTree = ""; }; + B2F0CF122A6EEFFA0015CBF5 /* SearchBarWithFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBarWithFilterView.swift; sourceTree = ""; }; + B2F0CF162A6EF0310015CBF5 /* SearchBarWithFilterView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SearchBarWithFilterView.xib; sourceTree = ""; }; + B2F0CF182A6EF15F0015CBF5 /* NewRecipesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRecipesView.swift; sourceTree = ""; }; + B2F0CF1A2A6EF16E0015CBF5 /* NewRecipesView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRecipesView.xib; sourceTree = ""; }; B2F799E32A34459B002F1894 /* MainTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabBar.swift; sourceTree = ""; }; B2F799E82A344B9A002F1894 /* MainTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabBarController.swift; sourceTree = ""; }; B85D26A62A3902DF000A463D /* EmailValidatorsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailValidatorsTests.swift; sourceTree = ""; }; @@ -400,7 +410,6 @@ 025511BC2A3C656300295B91 /* Recipe.swift */, 025511BA2A3C655200295B91 /* SavedRecipe.swift */, 798B59B12A5D15E600E4DCFF /* MealCategories.swift */, - 0286F2852A5EEB1800F20478 /* RandomMealEntity.swift */, C972DB2E2A5F6F91000041D1 /* FilterByMainIngredient.swift */, 6D6B89AC2A5DE99F00E52F4C /* FilterByArea.swift */, 0286F2852A5EEB1800F20478 /* RandomMealEntity.swift */, @@ -446,7 +455,7 @@ children = ( B2E577482A40DECF00FEFD05 /* SearchReceipes */, 025A47572A336C04008BF85A /* Views */, - 025A47502A336B05008BF85A /* DashboardViewController.swift */, + B2CA7C8A2A6F026D005C5993 /* DashboardViewController.swift */, 025A47522A336B05008BF85A /* DashboardViewController.xib */, 025A47512A336B05008BF85A /* DashboardViewModel.swift */, 025A474F2A336B05008BF85A /* DashboardViewModelType.swift */, @@ -457,10 +466,11 @@ 025A47572A336C04008BF85A /* Views */ = { isa = PBXGroup; children = ( - C9057FE32A48AC68002E4459 /* SliderDishesView */, + B2163C6E2A6EA35A003021B8 /* HomeHeaderView */, + B2F0CF112A6EEE200015CBF5 /* SearchBarWithFilterView */, B24160832A45B4DA000DF5BA /* FoodTagsView */, - 025A47582A336C2D008BF85A /* HomeHeaderView.swift */, - A29B4FAA2A38DB9D00965154 /* HomeHeaderView.xib */, + C9057FE32A48AC68002E4459 /* SliderDishesView */, + 209F93CE2A40C10000B007BA /* NewRecipesView */, ); path = Views; sourceTree = ""; @@ -718,17 +728,19 @@ isa = PBXGroup; children = ( 6D94975F2A4BB46A004A135C /* SkeletonViews */, - 209F93CE2A40C10000B007BA /* HomeNewRecipesView */, ); path = Views; sourceTree = ""; }; - 209F93CE2A40C10000B007BA /* HomeNewRecipesView */ = { + 209F93CE2A40C10000B007BA /* NewRecipesView */ = { isa = PBXGroup; children = ( + B2F0CF182A6EF15F0015CBF5 /* NewRecipesView.swift */, + B2F0CF1A2A6EF16E0015CBF5 /* NewRecipesView.xib */, 209F93D32A40C22900B007BA /* CollectionViewCell */, + B2AE66622A6F27E600937D29 /* HeaderView */, ); - path = HomeNewRecipesView; + path = NewRecipesView; sourceTree = ""; }; 209F93D32A40C22900B007BA /* CollectionViewCell */ = { @@ -895,6 +907,15 @@ path = SignButtonWithSocialMediaView; sourceTree = ""; }; + B2163C6E2A6EA35A003021B8 /* HomeHeaderView */ = { + isa = PBXGroup; + children = ( + 025A47582A336C2D008BF85A /* HomeHeaderView.swift */, + A29B4FAA2A38DB9D00965154 /* HomeHeaderView.xib */, + ); + path = HomeHeaderView; + sourceTree = ""; + }; B24160832A45B4DA000DF5BA /* FoodTagsView */ = { isa = PBXGroup; children = ( @@ -914,6 +935,14 @@ path = FoodTagCollectionViewCell; sourceTree = ""; }; + B2AE66622A6F27E600937D29 /* HeaderView */ = { + isa = PBXGroup; + children = ( + B2AE66632A6F283B00937D29 /* HeaderView.swift */, + ); + path = HeaderView; + sourceTree = ""; + }; B2B7AEE22A3B4CE500AF04F5 /* MainTabBarController */ = { isa = PBXGroup; children = ( @@ -963,6 +992,15 @@ path = "SearchReceipes "; sourceTree = ""; }; + B2F0CF112A6EEE200015CBF5 /* SearchBarWithFilterView */ = { + isa = PBXGroup; + children = ( + B2F0CF122A6EEFFA0015CBF5 /* SearchBarWithFilterView.swift */, + B2F0CF162A6EF0310015CBF5 /* SearchBarWithFilterView.xib */, + ); + path = SearchBarWithFilterView; + sourceTree = ""; + }; B2F799E72A344B6C002F1894 /* MainTabBarController */ = { isa = PBXGroup; children = ( @@ -1001,9 +1039,9 @@ C9057FE32A48AC68002E4459 /* SliderDishesView */ = { isa = PBXGroup; children = ( - C9057FE82A48AC81002E4459 /* SliderCollectionViewCell */, C9057FE52A48AC78002E4459 /* SliderDishesView.swift */, C9057FE42A48AC78002E4459 /* SliderDishesView.xib */, + C9057FE82A48AC81002E4459 /* SliderCollectionViewCell */, ); path = SliderDishesView; sourceTree = ""; @@ -1191,11 +1229,13 @@ A29B4FAB2A38DB9D00965154 /* HomeHeaderView.xib in Resources */, 027DDA282A0E6A680052818C /* Assets.xcassets in Resources */, B2E577432A40A52900FEFD05 /* SearchCollectionViewCell.xib in Resources */, + B2F0CF172A6EF0310015CBF5 /* SearchBarWithFilterView.xib in Resources */, 025511972A3C3F6400295B91 /* Poppins-Bold.ttf in Resources */, 02FDBC332A3A66780012AF87 /* PlaceholderView.xib in Resources */, 025A47562A336B05008BF85A /* DashboardViewController.xib in Resources */, 025511962A3C3F6400295B91 /* Poppins-Regular.ttf in Resources */, C9057FEC2A48AC8F002E4459 /* SliderCollectionViewCell.xib in Resources */, + B2F0CF1B2A6EF16E0015CBF5 /* NewRecipesView.xib in Resources */, 025511A02A3C5D7300295B91 /* SearchViewController.xib in Resources */, B241608C2A45B4DA000DF5BA /* FoodTagCollectionViewCell.xib in Resources */, ); @@ -1283,6 +1323,7 @@ buildActionMask = 2147483647; files = ( 0286F2862A5EEB1800F20478 /* RandomMealEntity.swift in Sources */, + B2F0CF192A6EF15F0015CBF5 /* NewRecipesView.swift in Sources */, 0266E7E62A56372500D5ABC4 /* UINavigationBar+Appearance.swift in Sources */, C2FE12122A412904001A7BE3 /* AnimatableView.swift in Sources */, 025511C42A3D058800295B91 /* AppCoordinator.swift in Sources */, @@ -1321,8 +1362,10 @@ B241608B2A45B4DA000DF5BA /* FoodTagCollectionViewCell.swift in Sources */, 025511BB2A3C655200295B91 /* SavedRecipe.swift in Sources */, 025511A82A3C5DAA00295B91 /* SavedRecipesViewModelType.swift in Sources */, + B2CA7C8B2A6F026D005C5993 /* DashboardViewController.swift in Sources */, 02892ECA2A599CBC001A3DB4 /* Container+Networking.swift in Sources */, 025511D02A3D0A8B00295B91 /* SplashViewModel.swift in Sources */, + B2AE66652A6F283B00937D29 /* HeaderView.swift in Sources */, 0296F7972A43491B00DBC86A /* FacebookAuthenticator.swift in Sources */, 025511B12A3C5F8900295B91 /* FilterSearchViewModelType.swift in Sources */, 025511BD2A3C656300295B91 /* Recipe.swift in Sources */, @@ -1352,6 +1395,7 @@ 27C7C7F62A4341A300FECE25 /* Logger.swift in Sources */, 025A47812A337320008BF85A /* Authentication.swift in Sources */, 025511D12A3D0A8B00295B91 /* SplashViewModelType.swift in Sources */, + B2F0CF132A6EEFFA0015CBF5 /* SearchBarWithFilterView.swift in Sources */, C9057FEB2A48AC8F002E4459 /* SliderCollectionViewCell.swift in Sources */, 027DDA212A0E6A660052818C /* SceneDelegate.swift in Sources */, 025A47532A336B05008BF85A /* DashboardViewModelType.swift in Sources */, @@ -1361,7 +1405,6 @@ 025A477B2A337320008BF85A /* EmailValidator.swift in Sources */, 020CF0B72A3FA8F600D81BC8 /* UIImage.Generated.swift in Sources */, B21F81BC2A419EC400905E50 /* SearchCollectionViewCell.swift in Sources */, - 025A47542A336B05008BF85A /* DashboardViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Healthy/Classes/Modules/Dashboard/DashboardViewController.swift b/Healthy/Classes/Modules/Dashboard/DashboardViewController.swift index 98410978..f1840b93 100644 --- a/Healthy/Classes/Modules/Dashboard/DashboardViewController.swift +++ b/Healthy/Classes/Modules/Dashboard/DashboardViewController.swift @@ -8,8 +8,12 @@ final class DashboardViewController: UIViewController { // MARK: Subviews - private let headerView = HomeHeaderView() - private let sliderDishesView = SliderDishesView() + @IBOutlet weak var headerView: HomeHeaderView! + // TODO: - [HT-48] Waiting for adding Home Search bar with filter view. + @IBOutlet weak var searchView: SearchBarWithFilterView! + @IBOutlet weak var foodTagsView: FoodTagsView! + @IBOutlet weak var sliderDishesView: SliderDishesView! + @IBOutlet private weak var newRecipesView: NewRecipesView! // MARK: Properties @@ -31,8 +35,7 @@ final class DashboardViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - - configureView() + refreshView() } } @@ -40,16 +43,6 @@ final class DashboardViewController: UIViewController { extension DashboardViewController {} -// MARK: - Configurations - -extension DashboardViewController { - func configureView() { - stackView.addArrangedSubview(sliderDishesView) - stackView.addArrangedSubview(headerView) - - } -} - // MARK: - Header Creation private extension DashboardViewController { @@ -72,5 +65,8 @@ private extension DashboardViewController { private extension DashboardViewController { func refreshView() { headerView.configure(with: viewModel.header) + foodTagsView.update(with: viewModel.foodTags) + sliderDishesView.update(with: viewModel.dishes) + newRecipesView.update(with: viewModel.newRecipes) } } diff --git a/Healthy/Classes/Modules/Dashboard/DashboardViewController.xib b/Healthy/Classes/Modules/Dashboard/DashboardViewController.xib index 3bf6dbcb..692e624e 100644 --- a/Healthy/Classes/Modules/Dashboard/DashboardViewController.xib +++ b/Healthy/Classes/Modules/Dashboard/DashboardViewController.xib @@ -4,11 +4,17 @@ + + + + + + @@ -21,8 +27,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47,4 +101,9 @@ - \ No newline at end of file + + + + + + diff --git a/Healthy/Classes/Modules/Dashboard/DashboardViewModel.swift b/Healthy/Classes/Modules/Dashboard/DashboardViewModel.swift index 8af00a67..e7a589e5 100644 --- a/Healthy/Classes/Modules/Dashboard/DashboardViewModel.swift +++ b/Healthy/Classes/Modules/Dashboard/DashboardViewModel.swift @@ -1,4 +1,5 @@ import Foundation +import UIKit // MARK: DashboardViewModel @@ -11,9 +12,67 @@ extension DashboardViewModel: DashboardViewModelInput {} // MARK: DashboardViewModelOutput extension DashboardViewModel: DashboardViewModelOutput { + var header: HomeHeaderView.ViewModel { - .init(title: "", subtitle: "", imageUrl: URL(string: "www.google.com")) + .init(title: "Name", subtitle: "subtitle", imageUrl: URL(string: "www.google.com")) + } + + var foodTags: FoodTagsView.ViewModel { + .init(foodCategories: [.init(foodCategoryName: "category1"), + .init(foodCategoryName: "category2"), + .init(foodCategoryName: "category3"), + .init(foodCategoryName: "category4"), + .init(foodCategoryName: "category5"), + .init(foodCategoryName: "category6")], + selected: .init(foodCategoryName: "category1")) { model in + print(model) + } + } + + var dishes: SliderDishesView.ViewModel { + .init(dishes: [ + .init(imageUrl: UIImage.previewDishes1, + dishName: "Crunchy Nut", + time: "", duration: "\(13) Mins", rating: 4.3), + .init(imageUrl: UIImage.previewDishes2, + dishName: "Crunchy Nut Coleslaw", + time: "6:00", duration: "\(15) Mins", rating: 4.3 ), + .init(imageUrl: nil, + dishName: "Test", + time: "", duration: "\(13) Mins", rating: 4.3), + .init(imageUrl: nil, + dishName: "Tes", + time: "", duration: "\(15) Mins", rating: 4.3) + ]) { model in + print(model) + } + } + + var newRecipes: NewRecipesView.ViewModel { + .init(newRecipes: [ + .init(recipeName: "Steak with tomato sauce and bulgur rice.", + userName: "By James Milner", + preparationTimeInMinutes: "20 mins", + recipeImageUrl: "google.com", + rating: 4, + userImageUrl: "google.com"), + .init(recipeName: "Pilaf sweet with lamb-and-raisins", + userName: "By Laura wilson", + preparationTimeInMinutes: "20 mins", + recipeImageUrl: "google.com", + rating: 3, + userImageUrl: "google.com"), + .init(recipeName: "Rice Pilaf, Broccoli and Chicken", + userName: "By Lucas Moura", + preparationTimeInMinutes: "10 mins", + recipeImageUrl: "google.com", + rating: 2, + userImageUrl: "google.com") + ]) { model in + print(model) + } } + } // MARK: Private Handlers diff --git a/Healthy/Classes/Modules/Dashboard/DashboardViewModelType.swift b/Healthy/Classes/Modules/Dashboard/DashboardViewModelType.swift index 2e9ef81c..34eb6097 100644 --- a/Healthy/Classes/Modules/Dashboard/DashboardViewModelType.swift +++ b/Healthy/Classes/Modules/Dashboard/DashboardViewModelType.swift @@ -12,4 +12,7 @@ protocol DashboardViewModelInput {} /// protocol DashboardViewModelOutput { var header: HomeHeaderView.ViewModel { get } + var foodTags: FoodTagsView.ViewModel { get } + var dishes: SliderDishesView.ViewModel { get } + var newRecipes: NewRecipesView.ViewModel { get } } diff --git a/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.swift b/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.swift index c223f477..528a99c8 100644 --- a/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.swift +++ b/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.swift @@ -72,6 +72,9 @@ extension FoodTagsView: UICollectionViewDataSource, UICollectionViewDelegate { cell.updateView(viewModel: element) let isSelected = viewModel.selected == element cell.setSelection(isSelected) + if isSelected { selectedIndex = indexPath + viewModel.onSelect(element) + } return cell } @@ -79,7 +82,6 @@ extension FoodTagsView: UICollectionViewDataSource, UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let element = viewModel.foodCategories[indexPath.row] - viewModel.onSelect(element) viewModel.selected = element if let selectedIndex { collectionView.reloadItems(at: [indexPath, selectedIndex]) @@ -147,7 +149,7 @@ private extension UICollectionViewLayout { let section = NSCollectionLayoutSection(group: group) section.orthogonalScrollingBehavior = .continuousGroupLeadingBoundary - section.contentInsets = NSDirectionalEdgeInsets(top: 8, leading: 20, bottom: 8, trailing: 20) + section.contentInsets = NSDirectionalEdgeInsets(top: 8, leading: 15, bottom: 8, trailing: 15) section.interGroupSpacing = 15 return UICollectionViewCompositionalLayout(section: section) diff --git a/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.xib b/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.xib index 2a1ad6de..10e99cd2 100644 --- a/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.xib +++ b/Healthy/Classes/Modules/Dashboard/Views/FoodTagsView/FoodTagsView.xib @@ -16,11 +16,11 @@ - + - + @@ -32,13 +32,13 @@ - + - + diff --git a/Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView.swift b/Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView/HomeHeaderView.swift similarity index 100% rename from Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView.swift rename to Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView/HomeHeaderView.swift diff --git a/Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView.xib b/Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView/HomeHeaderView.xib similarity index 100% rename from Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView.xib rename to Healthy/Classes/Modules/Dashboard/Views/HomeHeaderView/HomeHeaderView.xib diff --git a/Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift similarity index 88% rename from Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift rename to Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift index b4d2fc6f..3e8ecf7d 100644 --- a/Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift +++ b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.swift @@ -9,7 +9,6 @@ class HomeNewRecipeCollectionViewCell: UICollectionViewCell { @IBOutlet weak private(set) var userNameLabel: UILabel! @IBOutlet weak private(set) var preparationTimeInMinutesLabel: UILabel! @IBOutlet weak private(set) var recipeImage: UIImageView! - @IBOutlet weak private(set) var preparationTimeHorizontalStackView: UIStackView! @IBOutlet weak private(set) var cardView: UIView! // MARK: - Lifecycle @@ -22,9 +21,6 @@ class HomeNewRecipeCollectionViewCell: UICollectionViewCell { // MARK: - Private Methods private func configureAppearance() { - recipeNameLabel.applyStyle(.textFieldTitleLabel) - userNameLabel.applyStyle(.signupSubtitle) - preparationTimeInMinutesLabel.applyStyle(.signupSubtitle) cardView.applyDefaultCardShadow(cornerRadius: Constants.cornerRadius) } @@ -39,7 +35,7 @@ class HomeNewRecipeCollectionViewCell: UICollectionViewCell { /// Configures the cell view and binds the data from the provided view model. /// - Parameter with: The view model containing the data to be displayed in the cell view. /// - private func configure(with: ViewModel) { + func configure(with: ViewModel) { recipeNameLabel.text = with.recipeName userNameLabel.text = with.userName preparationTimeInMinutesLabel.text = with.preparationTimeInMinutes @@ -61,7 +57,7 @@ private extension HomeNewRecipeCollectionViewCell { /// Contains the necessary data for displaying the recipe information. /// - SeeAlso: `Recipe` /// -private extension HomeNewRecipeCollectionViewCell { +extension HomeNewRecipeCollectionViewCell { /// The view model used to configure the `HomeNewRecipeCollectionViewCell`. struct ViewModel { diff --git a/Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib similarity index 64% rename from Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib rename to Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib index 212cc401..e9c53aa2 100644 --- a/Healthy/Classes/Modules/Home/Views/HomeNewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib +++ b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/CollectionViewCell/HomeNewRecipeCollectionViewCell.xib @@ -8,48 +8,70 @@ + + + Poppins-Bold + + + Poppins-Regular + + - + - + - + - + - + - - - - + + - - + + - - + + + + + + + + + + + + + + + + + + - - + + @@ -61,34 +83,38 @@ - - - - - + + + + + + - + - + + + + @@ -96,17 +122,16 @@ - + - + - - + + - - + @@ -115,6 +140,7 @@ + @@ -127,23 +153,22 @@ - + - - + - + diff --git a/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/HeaderView/HeaderView.swift b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/HeaderView/HeaderView.swift new file mode 100644 index 00000000..41a129af --- /dev/null +++ b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/HeaderView/HeaderView.swift @@ -0,0 +1,35 @@ +import UIKit + +class HeaderView: UICollectionReusableView { + + var headerTitle = "New Recipes" + + private let title = UILabel() + + override init(frame: CGRect) { + super.init(frame: frame) + configure() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + fileprivate func configureTitle() { + title.font = UIFont(name: "Poppins", size: 18) + title.translatesAutoresizingMaskIntoConstraints = false + title.text = headerTitle + } + + private func configure() { + configureTitle() + backgroundColor = .red + addSubview(title) + backgroundColor = .clear + NSLayoutConstraint.activate([ + title.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 10), + title.centerYAnchor.constraint(equalTo: self.centerYAnchor) + ]) + } + +} diff --git a/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.swift b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.swift new file mode 100644 index 00000000..66557623 --- /dev/null +++ b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.swift @@ -0,0 +1,125 @@ +import UIKit + +// MARK: ViewModel + +extension NewRecipesView { + struct ViewModel { + var newRecipes: [HomeNewRecipeCollectionViewCell.ViewModel] = [] + var onSelect: (HomeNewRecipeCollectionViewCell.ViewModel) -> Void = { _ in } + } +} + +final class NewRecipesView: UIView { + + // MARK: Outlets + + @IBOutlet private(set) weak var newRecipesCollectionView: UICollectionView! + + // MARK: Properties + + private var viewModel = ViewModel() + + // MARK: Init + + override init(frame: CGRect) { + super.init(frame: frame) + initView() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + initView() + } +} + +// MARK: Configure Categories + +extension NewRecipesView { + func update(with viewModel: ViewModel) { + self.viewModel = viewModel + newRecipesCollectionView.reloadData() + } +} + +// MARK: Configurations + +private extension NewRecipesView { + private func initView() { + loadViewFromNib() + configureTagsCollectionView() + } + + private func configureTagsCollectionView() { + newRecipesCollectionView.collectionViewLayout = .createTagsLayout() + newRecipesCollectionView.register(HomeNewRecipeCollectionViewCell.self) + newRecipesCollectionView.register(HeaderView.self, + forSupplementaryViewOfKind: "header", + withReuseIdentifier: HeaderView.reuseIdentifier) + newRecipesCollectionView.dataSource = self + newRecipesCollectionView.delegate = self + } +} + +extension NewRecipesView: UICollectionViewDataSource, UICollectionViewDelegate { + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return viewModel.newRecipes.count + } + + func collectionView(_ collectionView: UICollectionView, + cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell: HomeNewRecipeCollectionViewCell = collectionView.dequeueReusableCell(for: indexPath) + // TODO: Make it safe get index + let viewModel = viewModel.newRecipes[indexPath.row] + cell.configure(with: viewModel) + return cell + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + viewModel.onSelect(viewModel.newRecipes[indexPath.row]) + } + + func collectionView(_ collectionView: UICollectionView, + viewForSupplementaryElementOfKind kind: String, + at indexPath: IndexPath) -> UICollectionReusableView { + guard let view = collectionView.dequeueReusableSupplementaryView( + ofKind: "header", + withReuseIdentifier: HeaderView.reuseIdentifier, + for: indexPath) as? HeaderView else { + assertionFailure("Could not dequeue Reusable Supplementar View") + return UICollectionReusableView()} + return view + } + +} + +// MARK: Layout + +private extension UICollectionViewLayout { + + static func createTagsLayout() -> UICollectionViewCompositionalLayout { + + let itemSize = NSCollectionLayoutSize( + widthDimension: .fractionalWidth(1.0), + heightDimension: .fractionalHeight(1.0)) + let item = NSCollectionLayoutItem(layoutSize: itemSize) + + let groupSize = NSCollectionLayoutSize( + widthDimension: .absolute(280), + heightDimension: .fractionalHeight(0.8)) + let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) + + let section = NSCollectionLayoutSection(group: group) + section.orthogonalScrollingBehavior = .continuousGroupLeadingBoundary + section.contentInsets = NSDirectionalEdgeInsets(top: 8, leading: 20, bottom: 8, trailing: 20) + section.interGroupSpacing = 15 + + let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .absolute(40)) + let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, + elementKind: "header", + alignment: .top) + section.boundarySupplementaryItems = [header] + + return UICollectionViewCompositionalLayout(section: section) + } +} diff --git a/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.xib b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.xib new file mode 100644 index 00000000..fa9fd214 --- /dev/null +++ b/Healthy/Classes/Modules/Dashboard/Views/NewRecipesView/NewRecipesView.xib @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.swift b/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.swift new file mode 100644 index 00000000..ee1588dd --- /dev/null +++ b/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.swift @@ -0,0 +1,26 @@ +import UIKit + +// TODO: - [HT-48] Waiting for adding Home Search bar with filter view. + +final class SearchBarWithFilterView: UIView { + + // MARK: Init + + override init(frame: CGRect) { + super.init(frame: frame) + initView() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + initView() + } +} + +// MARK: Configurations + +private extension SearchBarWithFilterView { + private func initView() { + loadViewFromNib() + } +} diff --git a/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.xib b/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.xib new file mode 100644 index 00000000..8b883f84 --- /dev/null +++ b/Healthy/Classes/Modules/Dashboard/Views/SearchBarWithFilterView/SearchBarWithFilterView.xib @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.swift b/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.swift index 9855101d..3cba6604 100644 --- a/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.swift +++ b/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.swift @@ -1,5 +1,12 @@ import UIKit +extension SliderDishesView { + struct ViewModel { + var dishes: [SliderCollectionViewCell.ViewModel] = [] + var onSelect: (SliderCollectionViewCell.ViewModel) -> Void = { _ in } + } +} + final class SliderDishesView: UIView { // MARK: - Outlet @@ -8,16 +15,7 @@ final class SliderDishesView: UIView { @IBOutlet private(set) weak var collectionView: UICollectionView! // MARK: - Properties - private var viewModel: [SliderCollectionViewCell.ViewModel] = [ - // TODO: To be removed when real data are integrated - .init(imageUrl: UIImage.previewDishes1, - dishName: "Crunchy Nut Coleslaw", time: "", - duration: "\(13) Mins", rating: 4.3), - .init(imageUrl: UIImage.previewDishes2, dishName: "Crunchy Nut Coleslaw", time: "6:00", - duration: "\(15) Mins", rating: 4.3 ), - .init(imageUrl: nil, dishName: "Test", time: "", duration: "\(13) Mins", rating: 4.3), - .init(imageUrl: nil, dishName: "Tes", time: "", duration: "\(15) Mins", rating: 4.3) - ] + private var viewModel: ViewModel = .init() // MARK: - initializer @@ -33,6 +31,15 @@ final class SliderDishesView: UIView { } } +// MARK: Update UI with ViewModle + +extension SliderDishesView { + func update(with viewModel: ViewModel) { + self.viewModel = viewModel + collectionView.reloadData() + } +} + // MARK: - CollectionView setup private extension SliderDishesView { @@ -46,13 +53,12 @@ private extension SliderDishesView { func configureCollectionViewLayout() { let layout = UICollectionViewFlowLayout() - layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + layout.sectionInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20) layout.itemSize = CGSize( width: collectionView.bounds.width * 0.4, height: collectionView.bounds.height ) - layout.minimumInteritemSpacing = 15 layout.minimumLineSpacing = 15 layout.scrollDirection = .horizontal @@ -67,14 +73,19 @@ private extension SliderDishesView { extension SliderDishesView: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - viewModel.count + viewModel.dishes.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell: SliderCollectionViewCell = collectionView.dequeueReusableCell(for: indexPath) - cell.configure(with: viewModel[indexPath.row]) + cell.configure(with: viewModel.dishes[indexPath.row]) return cell } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + viewModel.onSelect(viewModel.dishes[indexPath.row]) + } + } diff --git a/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.xib b/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.xib index 6268b352..27e1e725 100644 --- a/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.xib +++ b/Healthy/Classes/Modules/Dashboard/Views/SliderDishesView/SliderDishesView.xib @@ -33,7 +33,6 @@ - diff --git a/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/Contents.json b/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/Contents.json new file mode 100644 index 00000000..5f4e0e88 --- /dev/null +++ b/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "recipes-dishes-1.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/recipes-dishes-1.pdf b/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/recipes-dishes-1.pdf new file mode 100644 index 00000000..a9d1936c Binary files /dev/null and b/Healthy/Resources/Assets.xcassets/recipes-dishes-1.imageset/recipes-dishes-1.pdf differ diff --git a/Healthy/Resources/Generated/UIImage.Generated.swift b/Healthy/Resources/Generated/UIImage.Generated.swift index 9787635f..9d816e07 100644 --- a/Healthy/Resources/Generated/UIImage.Generated.swift +++ b/Healthy/Resources/Generated/UIImage.Generated.swift @@ -86,6 +86,10 @@ extension UIImage { UIImage(named: "preview-dishes-2")! } + static var recipesDishes1: UIImage { + UIImage(named: "recipes-dishes-1")! + } + static var star: UIImage { UIImage(named: "star")! } diff --git a/Networking/Sources/Networking/Constants.swift b/Networking/Sources/Networking/Constants.swift index 92fa6d70..b77940b6 100644 --- a/Networking/Sources/Networking/Constants.swift +++ b/Networking/Sources/Networking/Constants.swift @@ -24,7 +24,7 @@ enum Constants { return url }() - + static let firebaseKey: String = { return "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" }() diff --git a/Networking/Sources/Networking/Requests/MealCategoriesRequest.swift b/Networking/Sources/Networking/Requests/MealCategoriesRequest.swift index fd9d17c9..b6d10f3e 100644 --- a/Networking/Sources/Networking/Requests/MealCategoriesRequest.swift +++ b/Networking/Sources/Networking/Requests/MealCategoriesRequest.swift @@ -10,7 +10,7 @@ public struct Category: Decodable { let categoryId, categoryTitle: String let categoryThumb: String let categoryDescription: String - + enum CodingKeys: String, CodingKey { case categoryId = "idCategory" case categoryTitle = "strCategory" @@ -21,7 +21,7 @@ public struct Category: Decodable { // MARK: - MealCategoriesRequest public struct MealCategoriesRequest: RequestType { - + public typealias ResponseType = MealCategoriesResponse public init() {} diff --git a/Networking/Sources/Networking/Requests/RegisterRequest.swift b/Networking/Sources/Networking/Requests/RegisterRequest.swift index 708d145a..ac781f77 100644 --- a/Networking/Sources/Networking/Requests/RegisterRequest.swift +++ b/Networking/Sources/Networking/Requests/RegisterRequest.swift @@ -19,7 +19,7 @@ public struct RegisterRequest: RequestType { private let email: String private let password: String private let returnSecureToken: Bool - + public init(email: String, password: String, returnSecureToken: Bool = true) { self.email = email self.password = password diff --git a/Networking/Tests/NetworkingTests/Requests/MealCategoriesRequestTests.swift b/Networking/Tests/NetworkingTests/Requests/MealCategoriesRequestTests.swift index 0792dd93..bfa59105 100644 --- a/Networking/Tests/NetworkingTests/Requests/MealCategoriesRequestTests.swift +++ b/Networking/Tests/NetworkingTests/Requests/MealCategoriesRequestTests.swift @@ -4,24 +4,24 @@ import XCTest final class MealCategoriesRequestTests: XCTestCase { // MARK: Properties - + private var sut: MealCategoriesRequest! - + // MARK: - Lifecycle - + override func setUp() { sut = MealCategoriesRequest() } - + // MARK: - Tests - + func testMealCategoriesRequestProperties() { // Then XCTAssertEqual(sut.baseUrl, Constants.theMealDB) XCTAssertEqual(sut.path, "categories.php") XCTAssertEqual(sut.method, "GET") } - + func testMealCategoriesResponseDecoder() throws { // Given let mealCategoriesResponseAsString = """ @@ -31,16 +31,19 @@ final class MealCategoriesRequestTests: XCTestCase { "idCategory": "1", "strCategory": "Beef", "strCategoryThumb": "https://www.themealdb.com/images/category/beef.png", - "strCategoryDescription": "Beef is the culinary name for meat from cattle, particularly skeletal muscle. Humans have been eating beef since prehistoric times.[1] Beef is a source of high-quality protein and essential nutrients.[2]" + "strCategoryDescription": "Beef is the culinary name for meat/ + from cattle, particularly skeletal muscle. Humans have been eating beef since/ + prehistoric times.[1] Beef is a source of high-quality protein and essential/ + nutrients.[2]" } ] } """ - + // When let mealCategoriesResponseData = try XCTUnwrap(mealCategoriesResponseAsString.data(using: .utf8)) let mealCategoriesResponse = try? sut.responseDecoder(mealCategoriesResponseData) - + // Then XCTAssertNotNil(mealCategoriesResponse) XCTAssertEqual(mealCategoriesResponse?.categories.count, 1) diff --git a/Networking/Tests/NetworkingTests/Requests/RegisterRequestTests.swift b/Networking/Tests/NetworkingTests/Requests/RegisterRequestTests.swift index 3efe68ee..96b25c5a 100644 --- a/Networking/Tests/NetworkingTests/Requests/RegisterRequestTests.swift +++ b/Networking/Tests/NetworkingTests/Requests/RegisterRequestTests.swift @@ -4,7 +4,6 @@ import XCTest final class RegisterRequestTests: XCTestCase { // MARK: - Tests - func testRegisterRequestProperties() { // Given let email = "test@example.com" @@ -16,7 +15,7 @@ final class RegisterRequestTests: XCTestCase { XCTAssertEqual(registerRequest.path, "/accounts:signInWithPassword?key=\(Constants.firebaseKey)") XCTAssertEqual(registerRequest.method, "POST") } - + func testRegisterRequestResponseDecoder() throws { // Given let registerResponseAsString = """