//
//  SettingsDetailsCoordinator.swift
//  1Weather
//
//  Created by Dmitry Stepanets on 27.03.2021.
//

import UIKit

class SettingsDetailsCoordinator:Coordinator {
    //Private
    private let navigationController:UINavigationController
    private let settingsRow:SettingsRow
    
    //Public
    var childCoordinators = [Coordinator]()
    var parentCoordinator: Coordinator?
    
    init(navigationController:UINavigationController, settingsRow:SettingsRow) {
        self.settingsRow = settingsRow
        self.navigationController = navigationController
    }
    
    func start() {
        DispatchQueue.main.async {
            let viewController = SettingsDetailsViewController(coordinator: self, settingsRow: self.settingsRow)
            self.navigationController.pushViewController(viewController, animated: true)
        }
    }
    
    func viewControllerDidEnd(controller: UIViewController) {
        parentCoordinator?.childDidFinish(child: self)
    }
}
