         currentPage = min(currentPage, account.tabs.count - 1)
 
         var vcCache = [String: TimelineTableViewController]()
-        for tableViewController in tableViewControllers {
+        var buttonCache = [String: TabButton]()
+        for (index, tableViewController) in tableViewControllers.enumerate() {
             switch tableViewController {
             case let vc as HomeTimelineTableViewController:
                 vcCache["HomeTimelineTableViewController"] = vc

    // swiftlint:enable function_body_length

    func createTabButton(index: Int, icon: String) -> TabButton {
        let button = TabButton(type: UIButtonType.System)
        button.tag = index
        button.tintColor = UIColor.clearColor()
        button.titleLabel?.font = UIFont(name: "fontello", size: 20.0)

                let keyword = tab.keyword
                let svc = vcCache["SearchesTableViewController-" + keyword] as? SearchesTableViewController ?? SearchesTableViewController()
                svc.keyword = keyword
                cacheButton = buttonCache["SearchesTableViewController-" + keyword]
                cacheButton?.tag = i
                cacheButton?.frame = CGRect.init(x: 58 * CGFloat(i), y: 0, width: 58, height: 50)
                vc = svc
                icon = "探"
                title = keyword
