<commit_before>//
//  SearchViewController.swift
//  GitHubJobs
//
//  Created by <NAME> on 9/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class SearchViewController: UIViewController {

	lazy var searchButton: UIBarButtonItem = {
		let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.search, target: self, action: #selector(searchTapped))
		return button
	}()
	
	lazy var clearButton: UIBarButtonItem = {
		let button = UIBarButtonItem(title: "Clear", style: UIBarButtonItemStyle.done, target: self, action: #selector(clearTapped))
		return button
	}()
	
	lazy var spinner: UIActivityIndicatorView = {
		let view = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.whiteLarge)
		view.translatesAutoresizingMaskIntoConstraints = false
		return view
	}()
	
	lazy var spinnerConstraints: [NSLayoutConstraint] = {
		return [
			
		]
	}()
	
	lazy var tableViewConstraints: [NSLayoutConstraint] = {
		return [
			self.tableview.topAnchor.constraint(equalTo: self.tableview.topAnchor),
			self.tableview.leadingAnchor.constraint(equalTo: self.tableview.leadingAnchor),
			self.tableview.trailingAnchor.constraint(equalTo: self.tableview.trailingAnchor),
			self.tableview.bottomAnchor.constraint(equalTo: self.tableview.bottomAnchor)
		]
	}()
	
	let tableview: UITableView = {
		let t = UITableView()
		t.translatesAutoresizingMaskIntoConstraints = false
		return t
	}()
	
    override func viewDidLoad() {
        super.viewDidLoad()
		view.addSubview(tableview)
		view.sendSubview(toBack: tableview)
		NSLayoutConstraint.activate(tableViewConstraints)
		navigationController?.navigationItem.rightBarButtonItem = searchButton
		
    }
	
	@objc private func searchTapped() {
		view.bringSubview(toFront: tableview)
	}
	
	@objc private func clearTapped() {
		
	}
	
}<commit_msg>SearchViewController setup spinner, search and clear tapped<commit_after>//
//  SearchViewController.swift
//  GitHubJobs
//
//  Created by <NAME> on 9/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class SearchViewController: UIViewController {

	lazy var searchButton: UIBarButtonItem = {
		let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.search, target: self, action: #selector(searchTapped))
		return button
	}()
	
	lazy var clearButton: UIBarButtonItem = {
		let button = UIBarButtonItem(title: "Clear", style: UIBarButtonItemStyle.done, target: self, action: #selector(clearTapped))
		return button
	}()
	
	lazy var spinner: UIActivityIndicatorView = {
		let view = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.whiteLarge)
		view.translatesAutoresizingMaskIntoConstraints = false
		return view
	}()
	
	lazy var spinnerConstraints: [NSLayoutConstraint] = {
		return [
			self.view.centerXAnchor.constraint(equalTo: self.spinner.centerXAnchor),
			self.view.centerYAnchor.constraint(equalTo: self.spinner.centerYAnchor)
		]
	}()
	
	lazy var tableViewConstraints: [NSLayoutConstraint] = {
		return [
			self.tableview.topAnchor.constraint(equalTo: self.tableview.topAnchor),
			self.tableview.leadingAnchor.constraint(equalTo: self.tableview.leadingAnchor),
			self.tableview.trailingAnchor.constraint(equalTo: self.tableview.trailingAnchor),
			self.tableview.bottomAnchor.constraint(equalTo: self.tableview.bottomAnchor)
		]
	}()
	
	let tableview: UITableView = {
		let t = UITableView()
		t.translatesAutoresizingMaskIntoConstraints = false
		return t
	}()
	
    override func viewDidLoad() {
        super.viewDidLoad()
		title = "GitHub Jobs"
		view.backgroundColor = UIColor.lightGray
		view.addSubview(tableview)
		view.sendSubview(toBack: tableview)
		NSLayoutConstraint.activate(tableViewConstraints)
		view.addSubview(spinner)
		NSLayoutConstraint.activate(spinnerConstraints)
		navigationController?.navigationItem.rightBarButtonItem = searchButton
    }
	
	@objc private func searchTapped() {
		view.bringSubview(toFront: tableview)
		view.bringSubview(toFront: spinner)
	}
	
	@objc private func clearTapped() {
		view.sendSubview(toBack: tableview)
	}
	
}
{'fraction_non_alphanumeric': 0.09943943456007799, 'fraction_numerical': 0.004387033877650499, 'mean_word_length': 4.947826086956522, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '914157', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1270, 'n_words': 241}