     }
     
     override public func intrinsicContentSize() -> CGSize {
-        var height : CGFloat = 0
-        
-        let bottomMost = self.findBottomMost()
-        height = bottomMost.origin.y + cellInsets.bottom + bottomMost.size.height 
-        
-        return CGSizeMake(frame.width, contentHeight)
-    }
-    
+        var height: CGFloat = contentHeight
+        
+//        let bottomMost = self.findBottomMost()
+//        height = bottomMost.origin.y + cellInsets.bottom + bottomMost.size.height
+        
+        // Add extra space for page control
+        if /*let pcHeight = pageControl.frame.height where*/ pageControl.hidden == false {
+            height += pageControl.frame.height //pcHeight
+        }
+        
+        let size = CGSizeMake(frame.width, height)
+//        print("didChangeIntristicContentSize: \(size)")
+        return size
+    }
+    
+    
+    // MARK: - Helpers
+    
+    private func showPageControl(withPageCount pageCount: Int) {
+        if pageControl.superview == nil {
+            pageControl.addTarget(self, action: Selector("changePage:"), forControlEvents: UIControlEvents.ValueChanged)
+            self.addSubview(pageControl)
+            
+            // Autolayout
+            pageControl.translatesAutoresizingMaskIntoConstraints = false
+            let bindings = ["pageControl": pageControl]
+            self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[pageControl]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
+            self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[pageControl(\(kPageControlHeight))]|", options:NSLayoutFormatOptions(rawValue: 0), metrics:nil, views: bindings))
+        }
+        
+        contentViewToBottomConstraint.constant = kPageControlHeight
+        pageControl.numberOfPages = pageCount
+        pageControl.hidden = false
+    }
+    
+    private func hidePageControl() {
+        contentViewToBottomConstraint.constant = 0
+        pageControl.hidden = true
+    }
     
     private func findBottomMost() -> CGRect {
         
         var bottomMost = CGRectZero
-        for cell in subviews {            
-            if cell.frame.size.height + cell.frame.origin.y > bottomMost.size.height + bottomMost.origin.y {
+        
+        for cell in tagViews {
+            if CGRectGetMaxY(cell.frame) > CGRectGetMaxY(bottomMost) {
                 bottomMost = cell.frame
             }
         }

    }
    
    public func deselectTagAtIndex(index:Int) {
        tagViews[index].selected = false        
    }
    
    func tapSelect (sender : UITapGestureRecognizer) {

        }
        
        if currentLine.count > 0 {
            if isNewPageRequired() {
                addNewPage()
            }
            
            // we're done, finish off by adding the last row
            pages[currentPageIndex].append(currentLine)
//            rows.append(currentLine)
            rowsWidth[currentPageIndex].append(currentLineWidth)
//  self.addLine(line, cells: currentLine, currentLineWidth : currentLineWidth)
            
        }
        
        // Add all pages of rows of cell views to this view
        // and update contentHeight
        for pageIndex in 0..<pages.count {
            
            let currentPageHeight = (dataSource.heightOfTag(self) + self.cellInsets.top + cellInsets.bottom) * CGFloat(pages[pageIndex].count)
            contentHeight = max(contentHeight, currentPageHeight)
            
            for lineIndex in  0..<pages[pageIndex].count {
                self.addLine(lineIndex, ofTagViewCells: pages[pageIndex][lineIndex], currentLineWidth: rowsWidth[pageIndex][lineIndex], toPage: pageIndex)
            }
        }
        
        
        numberOfPages = pages.count
//        print("did reloadData - numberOfpages: \(numberOfPages)")
        if numberOfPages > 1 {
            showPageControl(withPageCount: numberOfPages)
        } else {
            hidePageControl()
        }
        
        
        self.contentView.contentSize = CGSizeMake(self.bounds.width * CGFloat(numberOfPages), contentHeight)
        
        self.invalidateIntrinsicContentSize()
        
    }
    
    func addLine(line : Int, ofTagViewCells cells : [TagViewCell], currentLineWidth : CGFloat, toPage pageIndex: Int) {
        
        let selfWidth = intrinsicContentSize().width
        
