<commit_before>//
//  NibButton.swift
//
//  Created by <NAME> on 2/03/2016.
//  Copyright © 2016 BareFeetWare. All rights reserved.
//

import UIKit

class NibButton: UIButton {

    // MARK: - Variables
    
    var contentView: BFWNibView!
    
    // MARK: - Init
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        commonInit()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        commonInit()
    }
    
    func commonInit() {
        addSubview(contentView)
        contentView.pinToSuperviewEdges()
        contentView.translatesAutoresizingMaskIntoConstraints = false
        contentView.userInteractionEnabled = false
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        commonAwake()
    }
    
    override func prepareForInterfaceBuilder() {
        super.prepareForInterfaceBuilder()
        commonAwake()
    }
    
    func commonAwake() {
        titleLabel?.text = titleForState(.Normal)
        setTitle(nil, forState: .Normal)
    }

}<commit_msg>NibButton: contentView changed from stored to get only, for overriding in subclass<commit_after>//
//  NibButton.swift
//
//  Created by <NAME> on 2/03/2016.
//  Copyright © 2016 BareFeetWare. All rights reserved.
//

import UIKit

class NibButton: UIButton {
    
    // MARK: - Variables
    
    /// Override in subclass
    var contentView: BFWNibView? {
        return nil
    }
    
    // MARK: - Init
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        commonInit()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        commonInit()
    }
    
    func commonInit() {
        if let contentView = contentView {
            addSubview(contentView)
            contentView.pinToSuperviewEdges()
            contentView.translatesAutoresizingMaskIntoConstraints = false
            contentView.userInteractionEnabled = false
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        commonAwake()
    }
    
    override func prepareForInterfaceBuilder() {
        super.prepareForInterfaceBuilder()
        commonAwake()
    }
    
    func commonAwake() {
        titleLabel?.text = titleForState(.Normal)
        setTitle(nil, forState: .Normal)
    }
    
}
{'fraction_non_alphanumeric': 0.09536082474226804, 'fraction_numerical': 0.009450171821305841, 'mean_word_length': 2.0325520833333335, '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': '3426883', 'n_tokens_mistral': 735, 'n_tokens_neox': 700, 'n_words': 146}