         } else {
             return nil
         }
+    }
+    
+    mutating func removeAll() {
+        keys.removeAll()
+        values.removeAll()
     }
 }
 

//                page.isLoaded = false
//            }
            
            var tabSectionScrollViewContentWidth: CGFloat = 0
            var contentSectionScrollViewContentWidth: CGFloat = 0
            let tabSectionScrollViewHeight = defaultTabHeight
            let contentSectionScrollViewHeight = self.frame.size.height - tabSectionScrollViewHeight
            
            // set tabSectionScrollView size
            tabSectionScrollView.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: tabSectionScrollViewHeight)
            tabSectionScrollView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "tabSectionScrollViewDidClick:"))
            
            // set contentSectionScrollView size
            contentSectionScrollView.frame = CGRect(x: 0, y: tabSectionScrollViewHeight, width: self.frame.size.width, height: contentSectionScrollViewHeight)
            
            // set pages and content views
            for i in 0..<numberOfPages {
                if let tabView = tabViewForPageAtIndex(i) {
                    tabView.frame = CGRect(

            tabSectionScrollView.backgroundColor = tabSectionBackgroundColor
            contentSectionScrollView.backgroundColor = contentSectionBackgroundColor
            
            // clear all caches
            cachedPageTabs.removeAll()
            for subview in tabSectionScrollView.subviews {
                subview.removeFromSuperview()
            }
            cachedPageContents.removeAll()
            for subview in contentSectionScrollView.subviews {
                subview.removeFromSuperview()
            }
