             delegate: self,
             cancelButtonTitle: NSLocalizedString("Dismiss", comment: "Button to dismiss network error message box")
         )
+        lastAlertTime = NSDate()
         alert.show()
     }
 }


class MainTabBarController : UITabBarController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.whiteColor()

            object: nil,
            queue: NSOperationQueue.mainQueue(),
            usingBlock: { _ in
                if NSDate().timeIntervalSinceDate(self.lastAlertTime) > NSTimeInterval(5) {
                    self.showNetworkErrorAlert()
                }
                if !CredentialManager.sharedInstance.hasCredentials() {
                    self.presentLoginView()
                }
