Commit f8ba7f43 authored by IOS Developer's avatar IOS Developer
Browse files

update logic for navigation

parent 7cc8063b
......@@ -26,7 +26,6 @@
11147AA6248671F800C6D56B /* DrawRouteType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147A4C248671F800C6D56B /* DrawRouteType.swift */; };
11147AA7248671F800C6D56B /* MapNavigationApiRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147A51248671F800C6D56B /* MapNavigationApiRequests.swift */; };
11147AA8248671F800C6D56B /* MapBoxNavigationApiRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147A52248671F800C6D56B /* MapBoxNavigationApiRequests.swift */; };
11147AA9248671F800C6D56B /* GoogleMapNavigationApiRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147A53248671F800C6D56B /* GoogleMapNavigationApiRequests.swift */; };
11147AAA248671F800C6D56B /* CKQuadTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 11147A5A248671F800C6D56B /* CKQuadTree.m */; };
11147AAB248671F800C6D56B /* clustering.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 11147A5D248671F800C6D56B /* clustering.xcassets */; };
11147AAC248671F800C6D56B /* CKClusterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 11147A5E248671F800C6D56B /* CKClusterManager.m */; };
......@@ -58,6 +57,7 @@
11147AC82486757100C6D56B /* MapNavigationModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147AC72486757100C6D56B /* MapNavigationModule.swift */; };
11147ACB248675E000C6D56B /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11147AC9248675E000C6D56B /* MapViewController.swift */; };
11147ACC248675E000C6D56B /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 11147ACA248675E000C6D56B /* MapViewController.xib */; };
1133F53524C8B373000F85F0 /* GoogleMapNavigationApiRequests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1133F53424C8B373000F85F0 /* GoogleMapNavigationApiRequests.swift */; };
1147C7D924727564001C9127 /* MainFlowsBarInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1147C7D824727564001C9127 /* MainFlowsBarInterface.swift */; };
1147C7DD24727769001C9127 /* SideBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1147C7DB24727769001C9127 /* SideBarViewController.swift */; };
1147C7DE24727769001C9127 /* SideBarViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1147C7DC24727769001C9127 /* SideBarViewController.xib */; };
......@@ -193,6 +193,7 @@
11BEB5D1248FA53100C51437 /* ChatMessageCellFabric.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11BEB5D0248FA53100C51437 /* ChatMessageCellFabric.swift */; };
11BEB5D4248FA6DC00C51437 /* MessageCellAbstract.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11BEB5D3248FA6DC00C51437 /* MessageCellAbstract.swift */; };
11CE0BEB246EA80100AA5A5E /* NavigationRouterModuleErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11CE0BEA246EA80100AA5A5E /* NavigationRouterModuleErrors.swift */; };
11D8FAB0256E59E6009CB13C /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11D8FAAF256E59E6009CB13C /* BaseViewController.swift */; };
11F2C9FB246D9A05005B52CC /* NavigationModuleAbstract.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11F2C9FA246D9A05005B52CC /* NavigationModuleAbstract.swift */; };
11F2C9FD246D9A11005B52CC /* NavigationRouterModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11F2C9FC246D9A11005B52CC /* NavigationRouterModule.swift */; };
11F2CA00246D9B5A005B52CC /* PopupModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11F2C9FF246D9B5A005B52CC /* PopupModuleInterface.swift */; };
......@@ -249,7 +250,6 @@
11147A4C248671F800C6D56B /* DrawRouteType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DrawRouteType.swift; sourceTree = "<group>"; };
11147A51248671F800C6D56B /* MapNavigationApiRequests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapNavigationApiRequests.swift; sourceTree = "<group>"; };
11147A52248671F800C6D56B /* MapBoxNavigationApiRequests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapBoxNavigationApiRequests.swift; sourceTree = "<group>"; };
11147A53248671F800C6D56B /* GoogleMapNavigationApiRequests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoogleMapNavigationApiRequests.swift; sourceTree = "<group>"; };
11147A58248671F800C6D56B /* CKAnnotationTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKAnnotationTree.h; sourceTree = "<group>"; };
11147A59248671F800C6D56B /* CKQuadTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKQuadTree.h; sourceTree = "<group>"; };
11147A5A248671F800C6D56B /* CKQuadTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CKQuadTree.m; sourceTree = "<group>"; };
......@@ -314,6 +314,7 @@
11147AC72486757100C6D56B /* MapNavigationModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapNavigationModule.swift; sourceTree = "<group>"; };
11147AC9248675E000C6D56B /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
11147ACA248675E000C6D56B /* MapViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
1133F53424C8B373000F85F0 /* GoogleMapNavigationApiRequests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoogleMapNavigationApiRequests.swift; sourceTree = "<group>"; };
1147C7D824727564001C9127 /* MainFlowsBarInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlowsBarInterface.swift; sourceTree = "<group>"; };
1147C7DB24727769001C9127 /* SideBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideBarViewController.swift; sourceTree = "<group>"; };
1147C7DC24727769001C9127 /* SideBarViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SideBarViewController.xib; sourceTree = "<group>"; };
......@@ -455,6 +456,7 @@
11BEB5D0248FA53100C51437 /* ChatMessageCellFabric.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMessageCellFabric.swift; sourceTree = "<group>"; };
11BEB5D3248FA6DC00C51437 /* MessageCellAbstract.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageCellAbstract.swift; sourceTree = "<group>"; };
11CE0BEA246EA80100AA5A5E /* NavigationRouterModuleErrors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationRouterModuleErrors.swift; sourceTree = "<group>"; };
11D8FAAF256E59E6009CB13C /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; };
11F2C9FA246D9A05005B52CC /* NavigationModuleAbstract.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationModuleAbstract.swift; sourceTree = "<group>"; };
11F2C9FC246D9A11005B52CC /* NavigationRouterModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationRouterModule.swift; sourceTree = "<group>"; };
11F2C9FF246D9B5A005B52CC /* PopupModuleInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupModuleInterface.swift; sourceTree = "<group>"; };
......@@ -686,9 +688,9 @@
11147A4F248671F800C6D56B /* ServerApi */ = {
isa = PBXGroup;
children = (
1133F53424C8B373000F85F0 /* GoogleMapNavigationApiRequests.swift */,
11147A50248671F800C6D56B /* Interface */,
11147A52248671F800C6D56B /* MapBoxNavigationApiRequests.swift */,
11147A53248671F800C6D56B /* GoogleMapNavigationApiRequests.swift */,
);
path = ServerApi;
sourceTree = "<group>";
......@@ -1250,6 +1252,7 @@
1176C0132470B23700ED9701 /* MustHave */ = {
isa = PBXGroup;
children = (
11D8FAAE256E59B4009CB13C /* BaseViewController */,
11147A44248671F800C6D56B /* BridgingHeaders */,
11147A41248671F800C6D56B /* Extension */,
11F2C9FE246D9B3F005B52CC /* PopupModule */,
......@@ -1802,6 +1805,14 @@
path = Errors;
sourceTree = "<group>";
};
11D8FAAE256E59B4009CB13C /* BaseViewController */ = {
isa = PBXGroup;
children = (
11D8FAAF256E59E6009CB13C /* BaseViewController.swift */,
);
path = BaseViewController;
sourceTree = "<group>";
};
11F2C9F9246D9895005B52CC /* NavigationRouterModule */ = {
isa = PBXGroup;
children = (
......@@ -2270,7 +2281,6 @@
buildActionMask = 2147483647;
files = (
1157BFF724AB7024008B6117 /* NetworkManagerInterface.swift in Sources */,
11147AA9248671F800C6D56B /* GoogleMapNavigationApiRequests.swift in Sources */,
1157C00924AB7024008B6117 /* NewsCellViewModelInterface.swift in Sources */,
1176BFF0246F68FA00ED9701 /* LocalizationController.swift in Sources */,
11147AB7248671F800C6D56B /* GQTPointQuadTree.m in Sources */,
......@@ -2290,6 +2300,7 @@
110D0A91248A22270077B60F /* ChatListViewController.swift in Sources */,
119A4D242488D11A00BD4860 /* ChatRoomDelegate.swift in Sources */,
1176C00B246F76F800ED9701 /* LocalizationConstants.swift in Sources */,
1133F53524C8B373000F85F0 /* GoogleMapNavigationApiRequests.swift in Sources */,
1157BFDB24AB7024008B6117 /* LoadingCollectionCellViewModel.swift in Sources */,
11F2CA07246D9CBA005B52CC /* BasePopupModule.swift in Sources */,
1157C00824AB7024008B6117 /* LoadingTableCellViewModelInterface.swift in Sources */,
......@@ -2314,6 +2325,7 @@
11BEB5CD248F6FA800C51437 /* ChatIncomingMessageCellTableViewCell.swift in Sources */,
11B9E38C246AEC8A005F231C /* UserApiRequests.swift in Sources */,
1157C00524AB7024008B6117 /* NewsListModelInterface.swift in Sources */,
11D8FAB0256E59E6009CB13C /* BaseViewController.swift in Sources */,
11147AAA248671F800C6D56B /* CKQuadTree.m in Sources */,
119A4D2E2488D9D800BD4860 /* ChatApiRequests.swift in Sources */,
1176C04324725CC200ED9701 /* MainModuleTabBarController.swift in Sources */,
......
......@@ -18,6 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
GMSServices.provideAPIKey(APIKeys.googleMap)
......
......@@ -11,39 +11,39 @@ import UIKit
class AuthNavigationModule: NavigationModuleAbstract {
override func startFlow() -> UIViewController {
let signInViewController = SignInViewController(authModuleNavigation: self)
navigationController.setViewControllers([signInViewController], animated: true)
currentViewController = signInViewController
return navigationController
}
func pushSignUpViewController() {
let signUpViewController = SignUpViewController(authModuleNavigation: self)
navigationController.pushViewController(signUpViewController, animated: true)
currentViewController = signUpViewController
}
func pushForgotPasswordViewController() {
let forgotPasswordViewController = ForgotPasswordViewController(authModuleNavigation: self)
navigationController.pushViewController(forgotPasswordViewController, animated: true)
currentViewController = forgotPasswordViewController
}
func popViewController() {
navigationController.popViewController(animated: true)
currentViewController = navigationController.topViewController
}
override func endFlow() {
navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: AuthNavigationModule.self)
}
override func endFlow(with nextNavigationModule: NavigationModuleAbstract.Type) {
navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: nextNavigationModule)
}
func setNextProfileFillingNavigationModule() {
endFlow(with: ProfileFillingNavigationModule.self)
}
// override func startFlow() -> UIViewController {
// let signInViewController = SignInViewController(authModuleNavigation: self)
// navigationController.setViewControllers([signInViewController], animated: true)
// currentViewController = signInViewController
// return navigationController
// }
//
// func pushSignUpViewController() {
// let signUpViewController = SignUpViewController(authModuleNavigation: self)
// navigationController.pushViewController(signUpViewController, animated: true)
// currentViewController = signUpViewController
// }
//
// func pushForgotPasswordViewController() {
// let forgotPasswordViewController = ForgotPasswordViewController(authModuleNavigation: self)
// navigationController.pushViewController(forgotPasswordViewController, animated: true)
// currentViewController = forgotPasswordViewController
// }
//
// func popViewController() {
// navigationController.popViewController(animated: true)
// currentViewController = navigationController.topViewController
// }
//
// override func endFlow() {
// navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: AuthNavigationModule.self)
// }
//
// override func endFlow(with nextNavigationModule: NavigationModuleAbstract.Type) {
// navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: nextNavigationModule)
// }
//
// func setNextProfileFillingNavigationModule() {
// endFlow(with: ProfileFillingNavigationModule.self)
// }
}
......@@ -8,7 +8,7 @@
import UIKit
class ForgotPasswordViewController: UIViewController {
class ForgotPasswordViewController: BaseViewController {
@IBOutlet weak var emailTextField: UITextField!
......@@ -16,17 +16,16 @@ class ForgotPasswordViewController: UIViewController {
var authModuleNavigation: AuthNavigationModule!
var popupModule: PopupModuleInterface!
init(authModuleNavigation: AuthNavigationModule) {
self.authModuleNavigation = authModuleNavigation
super.init(nibName: "ForgotPasswordViewController", bundle: nil)
popupModule = BasePopupController(viewController: self)
self.auth = AuthController(with: self)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.authModuleNavigation = (navigationModule as! AuthNavigationModule)
super.init(navigationModule: authModuleNavigation)
self.popupModule = BasePopupController(viewController: self)
self.auth = AuthController(with: self)
}
override func viewDidLoad() {
......
......@@ -8,7 +8,7 @@
import UIKit
class SignInViewController: UIViewController {
class SignInViewController: BaseViewController {
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var passwordTextField: UITextField!
......@@ -16,20 +16,18 @@ class SignInViewController: UIViewController {
var auth: AuthController!
var authModuleNavigation: AuthNavigationModule!
var popupModule: PopupModuleInterface!
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init(authModuleNavigation: AuthNavigationModule) {
self.authModuleNavigation = authModuleNavigation
super.init(nibName: "SignInViewController", bundle: nil)
popupModule = BasePopupController(viewController: self)
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.authModuleNavigation = (navigationModule as! AuthNavigationModule)
super.init(navigationModule: authModuleNavigation)
self.popupModule = BasePopupController(viewController: self)
self.auth = AuthController(with: self)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
}
override func viewDidLoad() {
super.viewDidLoad()
}
......@@ -62,11 +60,11 @@ extension SignInViewController {
}
@IBAction func signUpAction(_ sender: Any) {
authModuleNavigation.pushSignUpViewController()
authModuleNavigation.pushViewController(SignUpViewController.self, object: nil)
}
@IBAction func forgotPasswordAction(_ sender: Any) {
authModuleNavigation.pushForgotPasswordViewController()
authModuleNavigation.pushViewController(ForgotPasswordViewController.self, object: nil)
}
}
......
......@@ -8,7 +8,7 @@
import UIKit
class SignUpViewController: UIViewController {
class SignUpViewController: BaseViewController {
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var passwordTextField: UITextField!
......@@ -19,17 +19,15 @@ class SignUpViewController: UIViewController {
var authModuleNavigation: AuthNavigationModule!
var popupModule: PopupModuleInterface!
init(authModuleNavigation: AuthNavigationModule) {
self.authModuleNavigation = authModuleNavigation
super.init(nibName: "SignUpViewController", bundle: nil)
popupModule = BasePopupController(viewController: self)
self.auth = AuthController(with: self)
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.authModuleNavigation = (navigationModule as! AuthNavigationModule)
super.init(navigationModule: authModuleNavigation)
self.popupModule = BasePopupController(viewController: self)
self.auth = AuthController(with: self)
}
override func viewDidLoad() {
......@@ -76,7 +74,7 @@ extension SignUpViewController {
extension SignUpViewController: SuccessFailDelegate {
func success() {
authModuleNavigation.setNextProfileFillingNavigationModule()
authModuleNavigation.endFlow(with: ProfileFillingNavigationModule.self)
}
func failWithError(error: Error) {
......
......@@ -10,25 +10,25 @@ import Foundation
class ChatNavigationModule: NavigationModuleAbstract {
override func startFlow() -> UIViewController {
let chatListViewController = ChatListViewController(chatNavigationModule: self)
navigationController.setViewControllers([chatListViewController], animated: true)
currentViewController = chatListViewController
return navigationController
}
func pushChatViewController(with user: UserModelInterface) {
let chatViewController = ChatViewController.init(chatNavigationModule: self, with: user)
navigationController.pushViewController(chatViewController, animated: true)
currentViewController = chatViewController
}
func popViewController() {
navigationController.popViewController(animated: true)
currentViewController = navigationController.topViewController
}
override func endFlow() {
// navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: AuthNavigationModule.self)
}
// override func startFlow() -> UIViewController {
// let chatListViewController = ChatListViewController(chatNavigationModule: self)
// navigationController.setViewControllers([chatListViewController], animated: true)
// currentViewController = chatListViewController
// return navigationController
// }
//
// func pushChatViewController(with user: UserModelInterface) {
// let chatViewController = ChatViewController.init(chatNavigationModule: self, with: user)
// navigationController.pushViewController(chatViewController, animated: true)
// currentViewController = chatViewController
// }
//
// func popViewController() {
// navigationController.popViewController(animated: true)
// currentViewController = navigationController.topViewController
// }
//
// override func endFlow() {
//// navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: AuthNavigationModule.self)
// }
}
......@@ -56,7 +56,7 @@ extension ChatListViewController: UITableViewDataSource, UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let chatModel = chatListController.getChatModelByIndex(index: indexPath.row) else { return }
chatNavigationModule.pushChatViewController(with: chatModel.user)
chatNavigationModule.pushViewController(ChatViewController.self, object: chatModel.user)
}
}
......
......@@ -8,7 +8,7 @@
import UIKit
class ChatViewController: UIViewController {
class ChatViewController: BaseViewController {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var textView: UITextView!
......@@ -16,17 +16,17 @@ class ChatViewController: UIViewController {
var chatNavigationModule: ChatNavigationModule!
var chatController: ChatController!
init(chatNavigationModule: ChatNavigationModule, with user: UserModelInterface) {
self.chatNavigationModule = chatNavigationModule
super.init(nibName: "ChatViewController", bundle: nil)
self.chatController = ChatController(delegate: self, with: user)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.chatNavigationModule = (navigationModule as! ChatNavigationModule)
super.init(navigationModule: chatNavigationModule)
if let user = object as? UserModelInterface {
self.chatController = ChatController(delegate: self, with: user)
}
}
override func viewDidLoad() {
......
......@@ -28,12 +28,13 @@ class MainBottomBarNavigationModule: NavigationModuleAbstract {
required init(navigationController: UINavigationController, navigationRouterModuleDelegate: NavigationRouterModuleDelegate) {
fatalError("init(navigationController:navigationRouterModuleDelegate:) has not been implemented")
}
override func startFlow() -> UIViewController {
override func startFlow<T>(_ viewController: T.Type) -> (UINavigationController) where T : BaseViewController {
generateFlows()
createMainModuleTabBarController()
currentNavigationFlow = mainBottomNavigationFlows.first
return mainModuleTabBarController
let navigationController = UINavigationController.init(rootViewController: mainModuleTabBarController)
return navigationController
}
private func generateFlows() {
......@@ -46,10 +47,11 @@ class MainBottomBarNavigationModule: NavigationModuleAbstract {
}
private func createMainModuleTabBarController() {
mainModuleTabBarController = SideBarViewController.init(mainBottomBarController: self)
mainModuleTabBarController = MainModuleTabBarController.init(navigationModule: self, object: nil)
mainBottomNavigationFlows.enumerated().forEach { (index, navigationFlow) in
mainModuleTabBarController.appendViewController(viewController: navigationFlow.startFlow(), with: mainBottomNavigationModels[index], and: index)
mainModuleTabBarController.appendViewController(viewController: navigationFlow.startFlow(BaseViewController.self), with: mainBottomNavigationModels[index], and: index)
}
}
......
......@@ -20,15 +20,15 @@ class MainModuleTabBarController: UITabBarController, MainFlowsBarInterface {
}
var mainBottomBarController: MainBottomBarNavigationModule!
init(mainBottomBarController: MainBottomBarNavigationModule) {
self.mainBottomBarController = mainBottomBarController
super.init(nibName: "MainModuleTabBarController", bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.mainBottomBarController = (navigationModule as! MainBottomBarNavigationModule)
super.init(nibName: String(describing: type(of: self)), bundle: nil)
}
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
......
......@@ -8,7 +8,7 @@
import UIKit
class SideBarViewController: UIViewController, MainFlowsBarInterface {
class SideBarViewController: BaseViewController, MainFlowsBarInterface {
var flowViewControllers: [UIViewController]! {
get {
......@@ -32,14 +32,14 @@ class SideBarViewController: UIViewController, MainFlowsBarInterface {
var mainBottomBarController: MainBottomBarNavigationModule!
init(mainBottomBarController: MainBottomBarNavigationModule) {
self.mainBottomBarController = mainBottomBarController
required init(navigationModule: NavigationModuleAbstract? = nil, object: Any? = nil) {
self.mainBottomBarController = (navigationModule as! MainBottomBarNavigationModule)
super.init(navigationModule: self.mainBottomBarController, object: nil)
super.init(nibName: "SideBarViewController", bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) is not supported")
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
......
......@@ -11,24 +11,31 @@ import UIKit
class MapNavigationModule: NavigationModuleAbstract {
override func startFlow() -> UIViewController {
override func startFlow<T>(_ viewController: T.Type) -> (UINavigationController) where T : BaseViewController {
let mapViewController = MapViewController(mapNavigationModule: self)
navigationController.setViewControllers([mapViewController], animated: true)
currentViewController = mapViewController
return navigationController
}
override func endFlow() {}
override func endFlow(with nextNavigationModule: NavigationModuleAbstract.Type) {
navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: nextNavigationModule)
}
func setNextAuthNavigationModule() {
endFlow(with: AuthNavigationModule.self)
}
func setNextMainNavigationModule() {
endFlow(with: ProfileFillingNavigationModule.self)
}
// override func startFlow() -> UIViewController {
// let mapViewController = MapViewController(mapNavigationModule: self)
// navigationController.setViewControllers([mapViewController], animated: true)
// currentViewController = mapViewController
// return navigationController
// }
//
// override func endFlow() {}
//
// override func endFlow(with nextNavigationModule: NavigationModuleAbstract.Type) {
// navigationRouterModuleDelegate.startNextNavigationModule(nextNavigationModule: nextNavigationModule)
// }
//
// func setNextAuthNavigationModule() {
// endFlow(with: AuthNavigationModule.self)