//
//  TabBarController.swift
//  Home
//
//  Created by Richard Kuckovsky on 22.4.17.
//  Copyright © 2017 Richard Kuckovsky. All rights reserved.
//

import UIKit

class TabBarController: UITabBarController {
    
    var error:Bool = false

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
 
    }
    
    override func viewWillAppear(_ animated: Bool) {
        SocketIOManager.sharedInstance.checkError { (event) in
            if(!self.error) {
                
                self.error = true
                self.performSegue(withIdentifier: "connection_error", sender: self)
            }
        }
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        SocketIOManager.sharedInstance.stopCheckError()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
