             }
         }
     }
+    
+    private func lazyLoadPages() {
+        if (cachePageLimit > 0) {
+            var offset = Int(cachePageLimit / 2)
+            var leftBoundIndex = pageIndex - offset > 0 ? pageIndex - offset : 0
+            var rightBoundIndex = pageIndex + offset < pages.count ? pageIndex + offset : pages.count - 1
+            
+            var contentScrollViewContentWidth: CGFloat = 0.0
+            
+            for (var i = 0; i < self.pages.count; i++) {
+                var page = self.pages[i]
+                
+                // add
+                if (i >= leftBoundIndex && i <= rightBoundIndex && !page.isLoaded) {
+                    page.isLoaded = true
+                    page.contentView.frame = CGRect(x: contentScrollViewContentWidth, y: 0, width: page.contentView.frame.size.width, height: page.contentView.frame.size.height)
+                    contentScrollView.addSubview(page.contentView)
+                }
+                // remove
+                if ((i < leftBoundIndex || i > rightBoundIndex) && page.isLoaded) {
+                    page.isLoaded = false
+                    page.contentView.removeFromSuperview()
+                }
+                
+                contentScrollViewContentWidth += page.contentView.frame.size.width
+            }
+        }
+    }
 }
 
 class Page {

            
            // first time
            if (!isStarted) {
                isStarted = true
                
                // reset pageIndex
                pageIndex = defaultPage
            }
        }
    }

        contentScrollView.setContentOffset(contentScrollView.contentOffset, animated: false)
    }
    
    private func resetTabs() {
        if (tabGradient) {
            var currentIndex = pageIndex
            for (var i = 0; i < pages.count; i++) {
