forked from touchlab/KaMPKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
150 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// BreedDetailsNavController.swift | ||
// KaMPKitiOS | ||
// | ||
// Created by Bartłomiej Pedryc on 16/06/2023. | ||
// Copyright © 2023 Touchlab. All rights reserved. | ||
// | ||
|
||
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// BreedsNavController.swift | ||
// KaMPKitiOS | ||
// | ||
// Created by Bartłomiej Pedryc on 16/06/2023. | ||
// Copyright © 2023 Touchlab. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
func buildBreedsNavController(navController: BreedsNavController) -> UIViewController { | ||
let viewModel = Kotlin | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// AppNavigationController.swift | ||
// KaMPKitiOS | ||
// | ||
// Created by Bartłomiej Pedryc on 07/06/2023. | ||
// Copyright © 2023 Touchlab. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import Foundation | ||
|
||
class MainNavCoordinator: BreedsNavCoordinator { | ||
private let navController: UINavigationController | ||
|
||
init(navController: UINavigationController) { | ||
self.navController = navController | ||
} | ||
|
||
func start() { | ||
let controller = buildBreedsController(navCoordinator: self) | ||
navController.pushViewController(controller, animated: false) | ||
} | ||
|
||
func onBreedDetailsRequest(breedId: Int64) { | ||
let controller = buildBreedDetailsController(breedId: breedId) | ||
navController.pushViewController(controller, animated: true) | ||
} | ||
} | ||
|
||
private func buildBreedsController(navCoordinator: BreedsNavCoordinator) -> UIHostingController<BreedListScreen> { | ||
let viewModel = BreedsViewModel(navCoordinator: navCoordinator) | ||
return UIHostingController(rootView: BreedListScreen(viewModel: viewModel)) | ||
} | ||
|
||
private func buildBreedDetailsController(breedId: Int64) -> UIHostingController<BreedDetailsScreen> { | ||
let viewModel = BreedDetailsViewModel(breedId: breedId) | ||
return UIHostingController(rootView: BreedDetailsScreen(viewModel: viewModel)) | ||
} | ||
|
||
protocol BreedsNavCoordinator { | ||
func onBreedDetailsRequest(breedId: Int64) | ||
} |
Oops, something went wrong.