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

        self.navigationController!.toolbar.barTintColor = UIColor.digipostSpaceGrey()
    }
    
    func fetchReceiptsFromAPI() {
        print("Attempting to fetch data...")
        
        var fetchedReceipts: [POSReceipt] = []
        
        func setFetchedObjects(APICallResult: Dictionary<String,AnyObject>){
            self.receiptsTableViewDataSource.receipts = parseReceiptsFrom(APICallResult["receipt"]!) // set in success method as it's called asynchronously
            print("Successfully fetched receipts.")
            self.tableView.reloadData()
        }
        func f(e: APIError){ print(e.altertMessage) }
        

        
        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) {
