 
 import UIKit
 
-let useAutosizingCells = true
+private let useAutosizingCells = true
 
 class TableViewController: UITableViewController, UIAlertViewDelegate {
     

        })
    }
    
    func handleResponse(data: NSData!, response: NSURLResponse!, error: NSError!) {
        var jsonError: NSError?
        let dictionary = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.allZeros, error: &jsonError) as? Dictionary<String, AnyObject>
        let results = dictionary?[JSONResultsKey] as? Array<Dictionary<String, AnyObject>>
        
        if results != nil {
            for item in results! {
                stories.append(StoryModel(item))
            }
            
            tableView.reloadData()
        }
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return stories.count
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! UITableViewCell
        let story = stories[indexPath.row]
        
        cell.textLabel?.text = story.title
        cell.detailTextLabel?.text = story.author
        
        if useAutosizingCells && tableView.respondsToSelector("layoutMargins") {
            cell.textLabel?.numberOfLines = 0
            cell.detailTextLabel?.numberOfLines = 0
        }
        
        return cell
    }

}

    private let JSONResultsKey = "hits"
    private let JSONNumPagesKey = "nbPages"
    
    private var currentPage = 0
    private var numPages = 0
    private var stories: Array<StoryModel> = []
    
    // MARK: - Lifecycle
    
    override func viewDidLoad() {
        super.viewDidLoad()
