<commit_before>//
//  WardView.swift
//  dota-helper
//
//  Created by <NAME> on 2016-11-26.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

class WardView: UIView {

    @IBOutlet weak var countdownLabel: UILabel!
    
    var secondsRemaining = 6 * 60;
    var timer : Timer!;
    
    static func loadFromNib() -> WardView {
        return Bundle.main.loadNibNamed("WardView", owner: self, options: nil)![0] as! WardView
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateCounter), userInfo: nil, repeats: true)
    }
    
    func updateCounter() {
        secondsRemaining -= 1;
        let seconds = secondsRemaining % 60;
        let minutes = secondsRemaining / 60;
        countdownLabel.text = "\(minutes):\(seconds)"
    }

}<commit_msg>Using DateFormatter to format countdown [finish #134980061]<commit_after>//
//  WardView.swift
//  dota-helper
//
//  Created by <NAME> on 2016-11-26.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

class WardView: UIView {

    @IBOutlet weak var countdownLabel: UILabel!
    
    var secondsRemaining : TimeInterval = 6 * 60;
    var timer : Timer!;
    var dateFormatter = DateFormatter();
    
    static func loadFromNib() -> WardView {
        return Bundle.main.loadNibNamed("WardView", owner: self, options: nil)![0] as! WardView
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        dateFormatter.dateFormat = "m:ss"
        dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
        timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateCounter), userInfo: nil, repeats: true)
    }
    
    func updateCounter() {
        secondsRemaining -= 1;
        countdownLabel.text = dateFormatter.string(from: Date(timeIntervalSince1970: secondsRemaining))
    }

}
{'fraction_non_alphanumeric': 0.11746522411128284, 'fraction_numerical': 0.028851107676455434, 'mean_word_length': 2.79296875, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6313413', 'n_tokens_mistral': 659, 'n_tokens_neox': 602, 'n_words': 155}