//
//  SettingsCoordinator.swift
//  1Weather
//
//  Created by Dmitry Stepanets on 26.03.2021.
//

import UIKit

class SettingsCoordinator: Coordinator {
    //Private
    private let settingsViewModel = SettingsViewModel()
    private var parentViewController:UIViewController?
    
    //Public
    var childCoordinators = [Coordinator]()
    var parentCoordinator: Coordinator?
    
    init(parentViewController:UIViewController) {
        self.parentViewController = parentViewController
    }
    
    func start() {
        DispatchQueue.main.async {
            let settingsViewController = SettingsViewController(coordinator: self, settingsViewModel: self.settingsViewModel)
            let navVC = UINavigationController(rootViewController: settingsViewController)
            self.parentViewController?.present(navVC, animated: true)
        }
    }
    
    func viewControllerDidEnd(controller: UIViewController) {
        
    }
}
