<commit_before>//
//  UITableViewController.swift
//  ZamzamKit
//
//  Created by <NAME> on 4/7/16.
//  Copyright © 2016 Zamzam. All rights reserved.
//

import UIKit

public extension UITableViewController {

    /**
     Adds activity indicator to the table view.
     http://stackoverflow.com/questions/29912852/how-to-show-activity-indicator-while-tableview-loads

     - returns: Returns an instance of the activity indicator that is centered.
     */
    func setupActivityIndicator(
        style: UIActivityIndicatorViewStyle = .whiteLarge,
        color: UIColor = .gray) -> UIActivityIndicatorView {
            let activityIndicator = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
            activityIndicator.activityIndicatorViewStyle = style
            activityIndicator.color = color
            activityIndicator.hidesWhenStopped = true
            activityIndicator.center = view.center
            
            view.addSubview(activityIndicator)
        
            return activityIndicator
    }
    
        /**
     Adds refresh control for pull to refresh functionality.

     - parameter action: Action to trigger for reload.
     - parameter title:  Title of the refresh title.
     - parameter font:   Font of the title.
     - parameter color:  Color of the title.
     */
    func setupRefreshControl(_ action: Selector,
        title: String = "Pull to refresh",
        font: UIFont = UIFont(name: "AvenirNext-Medium", size: 18.0)!,
        color: UIColor = .lightGray) {
            let control = UIRefreshControl()
            control.attributedTitle = NSAttributedString(string: title, attributes: [
                NSFontAttributeName: font,
                NSForegroundColorAttributeName: color
            ])
            control.addTarget(self, action: action, for: .valueChanged)
        <commit_msg>Localized table pull to refresh<commit_after>//
//  UITableViewController.swift
//  ZamzamKit
//
//  Created by <NAME> on 4/7/16.
//  Copyright © 2016 Zamzam. All rights reserved.
//

import UIKit

public extension UITableViewController {

    /**
     Adds activity indicator to the table view.
     http://stackoverflow.com/questions/29912852/how-to-show-activity-indicator-while-tableview-loads

     - returns: Returns an instance of the activity indicator that is centered.
     */
    func setupActivityIndicator(
        style: UIActivityIndicatorViewStyle = .whiteLarge,
        color: UIColor = .gray) -> UIActivityIndicatorView {
            let activityIndicator = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
            activityIndicator.activityIndicatorViewStyle = style
            activityIndicator.color = color
            activityIndicator.hidesWhenStopped = true
            activityIndicator.center = view.center
            
            view.addSubview(activityIndicator)
        
            return activityIndicator
    }
    
        /**
     Adds refresh control for pull to refresh functionality.

     - parameter action: Action to trigger for reload.
     - parameter title:  Title of the refresh title.
     - parameter font:   Font of the title.
     - parameter color:  Color of the title.
     */
    func setupRefreshControl(_ action: Selector,
        title: String = "Pull to refresh".localized,
        font: UIFont = UIFont(name: "AvenirNext-Medium", size: 18.0)!,
        color: UIColor = .lightGray) {
            let control = UIRefreshControl()
            control.attributedTitle = NSAttributedString(string: title, attributes: [
                NSFontAttributeName: font,
                NSForegroundColorAttributeName: color
            ])
            control.addTarget(self, action: action, for: .valueChanged)
        
{'fraction_non_alphanumeric': 0.08266879319510899, 'fraction_numerical': 0.013290802764486975, 'mean_word_length': 2.3300884955752212, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5442425', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1000, 'n_words': 280}