<commit_before>//
//  ElloHUD.swift
//  Ello
//
//  Created by <NAME> on 11/26/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import UIKit
import MBProgressHUD

class ElloHUD: NSObject {

    class func showLoadingHudInView(view: UIView) -> MBProgressHUD? {
        let hud = MBProgressHUD.showHUDAddedTo(view, animated: true)
        hud.opacity = 0.0

        let elloLogo = UIImageView(image: UIImage(named: "ello-logo"))
        elloLogo.bounds = CGRectMake(0, 0, 60, 60)

        let rotate = CABasicAnimation(keyPath: "transform.rotation")
        rotate.fromValue = 0.0
        rotate.toValue = ((360*M_PI)/180)
        rotate.duration = 0.35<commit_msg>search for existing HUD view<commit_after>//
//  ElloHUD.swift
//  Ello
//
//  Created by <NAME> on 11/26/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import UIKit
import MBProgressHUD

class ElloHUD: NSObject {

    class func showLoadingHudInView(view: UIView) -> MBProgressHUD? {
        var existingHub: MBProgressHUD?
        for subview in view.subviews {
            if let found = subview as? MBProgressHUD {
                existingHub = found
                break
            }
        }
        if let existingHub = existingHub {
            return existingHub
        }

        let hud = MBProgressHUD.showHUDAddedTo(view, animated: true)
        hud.opacity = 0.0

        let elloLogo = UIImageView(image: UIImage(named: "ello-logo"))
        elloLogo.bounds = CGRectMake(0, 0, 60, 60)

        let rotate = CABasicAnimation(keyPath: "transform.rotation")
        rotate.fromValue = 0.0
        rotate.toValue = ((360*M_PI)/180)
        rotate.duration = 0.35
{'fraction_non_alphanumeric': 0.10783132530120482, 'fraction_numerical': 0.03493975903614458, 'mean_word_length': 2.282608695652174, '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': '1975435', 'n_tokens_mistral': 605, 'n_tokens_neox': 537, 'n_words': 133}