<commit_before>//
//  LunarHeaderView.swift
//  Luna
//
//  Created by <NAME> on 3/1/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit

final class LunarHeaderView: UIView {

    @IBOutlet var phaseView: LunarPhaseView!
    @IBOutlet var phaseNameLabel: UILabel!
    
    @IBOutlet var ageLabel: UILabel!
    @IBOutlet var illuminationLabel: UILabel!
    
    @IBOutlet var riseLabel: UILabel!
    @IBOutlet var setLabel: UILabel!
    
    var viewModel: LunarViewModel? {
        didSet {
            self.riseLabel.text = viewModel?.rise
            self.setLabel.text = viewModel?.set
            
            self.ageLabel.text = viewModel?.age
            self.illuminationLabel.text = viewModel?.illumination
            
            if let phase = viewModel?.phase {
                guard let font = UIFont(name: "EuphemiaUCAS", size: 38.0) else { fatalError() }
                let color = UIColor.white
                let attributes = [NSForegroundColorAttributeName: color, NSFontAttributeName: font]
                self.phaseNameLabel.attributedText = NSAttributedString(string: phase, attributes: attributes)
            }
            
            UIView.animate(withDuration: 0.5) { 
                self.phaseView.alpha = 1.0
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        <commit_msg>Use Swift 4 attribute format<commit_after>//
//  LunarHeaderView.swift
//  Luna
//
//  Created by <NAME> on 3/1/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit

final class LunarHeaderView: UIView {

    @IBOutlet var phaseView: LunarPhaseView!
    @IBOutlet var phaseNameLabel: UILabel!
    
    @IBOutlet var ageLabel: UILabel!
    @IBOutlet var illuminationLabel: UILabel!
    
    @IBOutlet var riseLabel: UILabel!
    @IBOutlet var setLabel: UILabel!
    
    var viewModel: LunarViewModel? {
        didSet {
            self.riseLabel.text = viewModel?.rise
            self.setLabel.text = viewModel?.set
            
            self.ageLabel.text = viewModel?.age
            self.illuminationLabel.text = viewModel?.illumination
            
            if let phase = viewModel?.phase {
                guard let font = UIFont(name: "EuphemiaUCAS", size: 38.0) else { fatalError() }
                let color = UIColor.white
                let attributes = [NSAttributedStringKey.foregroundColor: color, NSAttributedStringKey.font: font]
                self.phaseNameLabel.attributedText = NSAttributedString(string: phase, attributes: attributes)
            }
            
            UIView.animate(withDuration: 0.5) { 
                self.phaseView.alpha = 1.0
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
{'fraction_non_alphanumeric': 0.09081158383982839, 'fraction_numerical': 0.011083303539506614, 'mean_word_length': 1.9298429319371728, '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': '3604249', 'n_tokens_mistral': 883, 'n_tokens_neox': 827, 'n_words': 188}