//
//  AppTabBarController.swift
//  1Weather
//
//  Created by Dmitry Stepanets on 12.02.2021.
//

import UIKit

private enum AppTab:Int, CaseIterable {
    case today = 0
    case forecast = 1
    case radar = 2
    case menu = 3
}
class AppTabBarController: UITabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()

    }
    
    public func setupTabBar() {
        tabBar.tintColor = ThemeManager.currentTheme.tabBarTintColor
        tabBar.unselectedItemTintColor = ThemeManager.currentTheme.tabBarNormalColor
        
        AppTab.allCases.forEach {
            switch $0 {
            case .today:
                tabBar.items?[$0.rawValue].title = "TODAY"
                tabBar.items?[$0.rawValue].image = UIImage(named: "tab_today")
                tabBar.items?[$0.rawValue].selectedImage = UIImage(named: "tab_today_selected")
            case .forecast:
                tabBar.items?[$0.rawValue].title = "FORECAST"
                tabBar.items?[$0.rawValue].image = UIImage(named: "tab_forecast")
                tabBar.items?[$0.rawValue].selectedImage = UIImage(named: "tab_forecast_selected")
            case .radar:
                tabBar.items?[$0.rawValue].title = "RADAR"
                tabBar.items?[$0.rawValue].image = UIImage(named: "tab_radar")
                tabBar.items?[$0.rawValue].selectedImage = UIImage(named: "tab_radar_selected")
            case .menu:
                tabBar.items?[$0.rawValue].title = "MENU"
                tabBar.items?[$0.rawValue].image = UIImage(named: "tab_menu")
                tabBar.items?[$0.rawValue].selectedImage = UIImage(named: "tab_menu_selected")
            }
        }
    }
}
