<commit_before>//
//  UILabel.swift
//  Rex
//
//  Created by <NAME> on 6/19/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import ReactiveCocoa
import UIKit

extension UILabel {
    /// Wraps a label's `text` value in a bindable property.
    public var rex_text: MutableProperty<String> {
        return rex_stringProperty("text")
    }
    
    public var rex_textColor: MutableProperty<UIColor> {
        return rex_valueProperty(&textColor, { [weak self] in (self?.textColor)! }, { [weak self] in self?.textColor = $0 })
    }<commit_msg>Use the default color of a new UILabel as fallback instead of force unwrapping<commit_after>//
//  UILabel.swift
//  Rex
//
//  Created by <NAME> on 6/19/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import ReactiveCocoa
import UIKit

extension UILabel {
    /// Wraps a label's `text` value in a bindable property.
    public var rex_text: MutableProperty<String> {
        return rex_stringProperty("text")
    }
    
    public var rex_textColor: MutableProperty<UIColor> {
        return rex_valueProperty(&textColor, { [weak self] in self?.textColor ?? UILabel().textColor }, { [weak self] in self?.textColor = $0 })
    }
{'fraction_non_alphanumeric': 0.12364243943191311, 'fraction_numerical': 0.01670843776106934, 'mean_word_length': 3.0336700336700337, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2069360', 'n_tokens_mistral': 415, 'n_tokens_neox': 394, 'n_words': 116}