<commit_before>//
//  ProgressHUDDelegate.swift
//  SonicWords
//
//  Created by <NAME> on 5/19/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import UIKit
import MBProgressHUD

public protocol ProgressHUDDelegate {
    
    func showProgressHud()
    
    func showProgressHud(string: String)
    
    func hideProgressHud()
    
}

extension UIViewController: ProgressHUDDelegate {
    
    public func showProgressHud() {
        MBProgressHUD.showHUDAddedTo(view, animated: true)
    }
    
    public func showProgressHud(string: String) {
        let progressHUD = MBProgressHUD.showHUDAddedTo(view, animated: true)
        progressHUD.labelText = string
    }
    <commit_msg>Commenting that showProgressHud() freezes the UI<commit_after>//
//  ProgressHUDDelegate.swift
//  SonicWords
//
//  Created by <NAME> on 5/19/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import UIKit
import MBProgressHUD

public protocol ProgressHUDDelegate {
    
    func showProgressHud(labelText: String?)
    
    func hideProgressHud()
    
}

extension UIViewController: ProgressHUDDelegate {
    
    /**
     Show a progress hud attached to the viewController's view.
     - parameter labelText: A label text to be shown under the progress hud.
     - Warning: Showing a progress hud freezes the UI of the view it is attached to.
     */
    public func showProgressHud(labelText: String? = .None) {
        let progressHUD = MBProgressHUD.showHUDAddedTo(view, animated: true)
        
        if let labelText = labelText {
            progressHUD.labelText = labelText
        }
    }
    
{'fraction_non_alphanumeric': 0.08032378580323786, 'fraction_numerical': 0.0112079701120797, 'mean_word_length': 2.6942528735632183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3133582', 'n_tokens_mistral': 503, 'n_tokens_neox': 480, 'n_words': 136}