         fetchNextPageAction()
     }
     
+    
+    // MARK: - UIScrollViewDelegate
+    
     override func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
         showNextPage()
     }

            voteAction(link, .None)
        }
    }
    
    func configureThumbnailLinkCell(cell: ThumbnailLinkCell, link: Link, indexPath: NSIndexPath) {
        if !cell.styled {
            let style = UIApplication.services.style
            style.applyToThumbnailLinkCell(cell)
        }
        cell.thumbnailImageView.image = fetchThumbnailAction(link.thumbnail, indexPath)
        cell.titleLabel.text = link.title
        cell.authorLabel.text = "\(link.author) · \(link.domain) · \(link.subreddit)"
        cell.commentsButton.setTitle("\(link.commentCount) comments", forState: .Normal)
        cell.vote(link.likes)
        cell.commentsAction = { [unowned self] in
            self.showCommentsAction(link)
        }
        cell.upvoteAction = { [unowned self] (selected) in
            self.upvoteLink(link, upvote: selected)
        }
        cell.downvoteAction = { [unowned self] (selected) in
            self.downvoteLink(link, downvote: selected)
        }
    }
    
    func configureTextOnlyLinkCell(cell: TextOnlyLinkCell, link: Link, indexPath: NSIndexPath) {
        if !cell.styled {
            let style = UIApplication.services.style
            style.applyToTextOnlyLinkCell(cell)
        }
        cell.titleLabel.text = link.title
        cell.authorLabel.text = "\(link.author) · \(link.domain) · \(link.subreddit)"
        cell.commentsButton.setTitle("\(link.commentCount) comments", forState: .Normal)
        cell.vote(link.likes)
        cell.commentsAction = { [unowned self] in
            self.showCommentsAction(link)
        }
        cell.upvoteAction = { [unowned self] (selected) in
            self.upvoteLink(link, upvote: selected)
        }
        cell.downvoteAction = { [unowned self] (selected) in
            self.downvoteLink(link, downvote: selected)
        }
    }
    
    func pullToRefreshValueChanged(control: UIRefreshControl) {
        resetCellHeightCache()

            return cell
        }
    }
    
    
    // MARK: - UITableViewDelegate
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        if let cachedHeight = cellHeightCache[indexPath] {
