 
 import UIKit
 
-class UncategorisedReceiptsViewController: UIViewController, UITableViewDelegate, UIGestureRecognizerDelegate {
+class UncategorisedReceiptsViewController: UIViewController, UITableViewDelegate, UIScrollViewDelegate, UIGestureRecognizerDelegate {
     
     @IBOutlet weak var tableView: UITableView!
     

    }
    
    func scrollViewDidScroll(scrollView: UIScrollView) {
        let scrollViewHeight: CGFloat = scrollView.frame.size.height;
        let scrollViewContentSizeHeight: CGFloat = scrollView.contentSize.height;
        let scrollOffset: CGFloat = scrollView.contentOffset.y;
        
        if(self.numberOfReceiptsChangedUponLastUpdate &&
            scrollOffset + scrollViewHeight >= 0.8 * scrollViewContentSizeHeight) {
            // load more
            loadAdditionalReceipts()
        }
    }
    
    func loadAdditionalReceipts() {
        let previousNumberOfReceipts = 0 // get from data source
        // update
        let updatedNumberOfReceipts = 0 // get from data source
        
        self.numberOfReceiptsChangedUponLastUpdate = (previousNumberOfReceipts == updatedNumberOfReceipts) ? false : true;
    }

        
        self.navigationItem.title = "Receipts"
        
        self.tableView.rowHeight = UITableViewAutomaticDimension
        self.tableView.estimatedRowHeight = 160
        self.tableView.separatorInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0)
        self.tableView.layoutMargins = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0)
        
        let tableFooterView = UIView(frame: CGRectZero)
        self.tableView.tableFooterView = tableFooterView
        self.tableView.tableFooterView?.hidden = true
        self.tableView.backgroundColor = UIColor.digipostAccountViewBackground()
        
        self.receiptsTableViewDataSource = UncategorisedReceiptsTableViewDataSource.init(asDataSourceForTableView: self.tableView)
        self.tableView.delegate = self;
        self.tableView.addSubview(self.refreshControl)
    }
    
    override func viewWillAppear(animated: Bool) {
