<commit_before>//
//  NearbyViewController.swift
//  ClassInTouch
//
//  Created by <NAME> on 10/24/15.
//  Copyright © 2015 ClassInTouch. All rights reserved.
//

import UIKit

class NearbyViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

    // MARK: Properties

    @IBOutlet weak var tableView: UITableView!

    @IBOutlet weak var button1: UIButton!
    lazy var context: NSManagedObjectContext = {
        let delegate: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
        return delegate.managedObjectContext
        }()

    lazy var classes: [Class] = {
        do {
            return try self.context.objects("User") as! [Class]
        } catch {
            return []
        }
        }()

    lazy var networkHandler: PGNetworkHandler = {
        return PGNetworkHandler(baseURL: NSURL(string: "http://classintouch.me"))
        }()

    // MARK: ViewController
    override func viewDidLoad() {
        super.viewDidLoad()
        // case of normal image
        let image1 = UIImage(named: "LonelyCircle.pdf")!
        self.button1.setImage(image1, forState: UIControlState.Normal)

        // TODO: Use current lon & lat
        networkHandler.nearbyCourse(100, latitude: 100, context: context, success: nil, failure: nil) { () -> Void in
            self.tableView.reloadData()
        }
    }
    @IBAction func Pressed(sender: UIButton) {
    }

    // MARK: - UITableViewDataSource

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("NearbyCell", forIndexPath: indexPath)<commit_msg>UI now uses logo-based icons<commit_after>//
//  NearbyViewController.swift
//  ClassInTouch
//
//  Created by <NAME> on 10/24/15.
//  Copyright © 2015 ClassInTouch. All rights reserved.
//

import UIKit

class NearbyViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

    // MARK: Properties

    @IBOutlet weak var navigationUI: UINavigationItem!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var buttonLabel: UILabel!
    @IBOutlet weak var blueNeighborBig: UIImageView!

    @IBOutlet weak var blueNeighborSmall: UIImageView!
    @IBOutlet weak var button1: UIButton!
    lazy var context: NSManagedObjectContext = {
        let delegate: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
        return delegate.managedObjectContext
        }()

    lazy var classes: [Class] = {
        do {
            return try self.context.objects("User") as! [Class]
        } catch {
            return []
        }
        }()

    lazy var networkHandler: PGNetworkHandler = {
        return PGNetworkHandler(baseURL: NSURL(string: "http://classintouch.me"))
        }()

    // MARK: ViewController
    override func viewDidLoad() {
        // Set up the button
        super.viewDidLoad()
        // case of normal image
        let image1 = UIImage(named: "Circle")!
        self.button1.setImage(image1, forState: UIControlState.Normal)
        //Hide the bar's + button, and temporarily name
        //self.navigationUI.rightBarButtonItem.
        
        
        

        // TODO: Use current lon & lat
        networkHandler.nearbyCourse(100, latitude: 100, context: context, success: nil, failure: nil) { () -> Void in
            self.tableView.reloadData()
        }
    }
    
    override func viewDidAppear(animated: Bool) {
        self.navigationController?.setNavigationBarHidden(true, animated: animated)
        self.blueNeighborBig.hidden=true
        self.blueNeighborSmall.hidden=true
        
        self.buttonLabel.hidden = false
    }
    
    @IBAction func Pressed(sender: UIButton) {
        self.navigationController?.setNavigationBarHidden(false, animated: true)
        self.blueNeighborBig.hidden=false
        self.blueNeighborSmall.hidden=false
        
        self.buttonLabel.hidden = true
    }

    // MARK: - UITableViewDataSource

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("NearbyCell", forIndexPath: indexPath)
{'fraction_non_alphanumeric': 0.0954963452016034, 'fraction_numerical': 0.009431737797689225, 'mean_word_length': 2.6983435047951176, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6342396', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1161, 'n_words': 289}