//
//  ChatViewController.swift
//  Em-call
//
//  Created by Alex Sh on 15.02.2022.
//

import UIKit

class ChatViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
       
        let rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "but_left"), style: .done, target: self, action: #selector(call_Method))

        // Для Tab bar
        self.tabBarController?.navigationItem.rightBarButtonItems = [rightBarButtonItem]

        // Для NavigationController
        self.navigationController?.navigationItem.rightBarButtonItems = [rightBarButtonItem]

        // Обязательно! добавить @objc

        }
    @objc func call_Method () {
    print("Click")
    }
    
    override func viewWillAppear(_ animated: Bool) {
        self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor : UIColor.black]
        self.navigationController?.navigationBar.barTintColor = UIColor.white
        self.navigationController?.navigationBar.topItem?.title = "CHAT"
        self.navigationController?.navigationItem.title = "CHAT"
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
