<commit_before>//
//  FollowersViewController.swift
//  im-in-ios
//
//  Created by <NAME> on 8/15/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Foundation<commit_msg>created view for followers<commit_after>//
//  ViewController.swift
//  Im_in
//
//  Created by <NAME> on 2014-08-14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import UIKit

//
//, APIControllerProtocol
class FollowersViewController: UIViewController, APIFollowersControllerProtocol, UITableViewDataSource, UITableViewDelegate {
    
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var button: UIButton!
    var apiCtrl = APIFollowersController()
    var followers: NSArray!
    
    func didReceiveAPIResults(results: NSDictionary) {
        println("FollowersViewController#didReceiveAPIResults")
        //        println(results)
        followers = results.objectForKey("followers") as? NSArray
        //        println("****")
        println(followers)
        self.tableView.reloadData()
    }
    
    
    @IBAction func buttonPressed(sender: AnyObject) {
        //apiCtrl.loadAllEvents()
        
    }
    
    func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
        println("FollowersViewController#tableView (count)")
        if followers == nil {
            return 0
        }
        return followers.count;
    }
    
    // Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
    // Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)
    
    func tableView(tableView:UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
        
        println("FollowersViewController#tableView")
        
        let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Value1, reuseIdentifier: "MyTestCell")
        //        println("***")
        
        //        cell.textLabel.text = "Row #\(indexPath.row)"
        cell.textLabel.text = followers[indexPath.row].objectForKey("username") as? String
        
        
        return cell
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        println("FollowersViewController#viewDidLoad")
        apiCtrl.delegate = self
        apiCtrl.loadAllEvents()
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
}


{'fraction_non_alphanumeric': 0.09650455927051672, 'fraction_numerical': 0.008738601823708206, 'mean_word_length': 2.616758241758242, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4548491', 'n_tokens_mistral': 769, 'n_tokens_neox': 705, 'n_words': 175}