<commit_before>//
//  RSRoundBorderedButton.swift
//  Credits: https://github.com/yhpark/YHRoundBorderedButton
//
//  Created by <NAME> on 03.02.15.
//  Copyright (c) 2015 Rusty1s. All rights reserved.
//

import UIKit

class RSRoundBorderedButton : UIButton {
    
    // MARK: Initializers
    
    convenience init() {
        self.init(frame: CGRectZero)
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setup()
    }

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setup()
    }
    
    // MARK: Setup
    
    private func setup() {
        setTitleColor(tintColor, forState: .Normal)
        setTitleColor(UIColor.whiteColor(), forState: .Highlighted)
        setTitleColor(UIColor.lightGrayColor(), forState: .Disabled)
        
        layer.cornerRadius = 3.5
        layer.borderWidth = 1
        contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10)
        
        refreshBorderColor()
    }
    
    private func refreshBorderColor() {
        layer.borderColor = enabled ? tintColor?.CGColor : UIColor.lightGrayColor().CGColor
    }
    
    // MARK: Override
    
    override var tintColor: UIColor? {
    set(newTintColor) {
        super.tintColor = newTintColor
        setTitleColor(newTintColor, forState: .Normal)
        refreshBorderColor()
    }
    get { return super.tintColor }
    }
    
    override var enabled: Bool {
    set(newEnabled) {
        super.enabled = newEnabled
        refreshBorderColor()
    }
    get { return super.enabled }
    }
    
    override var highlighted: Bool {
    set(newHighlighted) {
        if highlighted != newHighlighted {
            super.highlighted = newHighlighted
            
            UIView.animateWithDuration(0.25) {
                self.layer.backgroundColor = self.highlighted ? self.tintColor?.CGColor : UIColor.whiteColor().CGColor
            }
            
            setNeedsDisplay()
        }
    }
    get { return super.highlighted }
    }
}<commit_msg>Added public to class and functions<commit_after>//
//  RSRoundBorderedButton.swift
//  Credits: https://github.com/yhpark/YHRoundBorderedButton
//
//  Created by <NAME> on 03.02.15.
//  Copyright (c) 2015 Rusty1s. All rights reserved.
//

import UIKit

public class RSRoundBorderedButton : UIButton {
    
    // MARK: Initializers
    
    public convenience init() {
        self.init(frame: CGRectZero)
    }
    
    public override init(frame: CGRect) {
        super.init(frame: frame)
        setup()
    }

    public required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setup()
    }
    
    // MARK: Setup
    
    private func setup() {
        setTitleColor(tintColor, forState: .Normal)
        setTitleColor(UIColor.whiteColor(), forState: .Highlighted)
        setTitleColor(UIColor.lightGrayColor(), forState: .Disabled)
        
        layer.cornerRadius = 3.5
        layer.borderWidth = 1
        contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10)
        
        refreshBorderColor()
    }
    
    private func refreshBorderColor() {
        layer.borderColor = enabled ? tintColor?.CGColor : UIColor.lightGrayColor().CGColor
    }
    
    // MARK: Override
    
    public override var tintColor: UIColor? {
    set(newTintColor) {
        super.tintColor = newTintColor
        setTitleColor(newTintColor, forState: .Normal)
        refreshBorderColor()
    }
    get { return super.tintColor }
    }
    
    public override var enabled: Bool {
    set(newEnabled) {
        super.enabled = newEnabled
        refreshBorderColor()
    }
    get { return super.enabled }
    }
    
    public override var highlighted: Bool {
    set(newHighlighted) {
        if highlighted != newHighlighted {
            super.highlighted = newHighlighted
            
            UIView.animateWithDuration(0.25) {
                self.layer.backgroundColor = self.highlighted ? self.tintColor?.CGColor : UIColor.whiteColor().CGColor
            }
            
            setNeedsDisplay()
        }
    }
    get { return super.highlighted }
    }
}
{'fraction_non_alphanumeric': 0.09648484848484848, 'fraction_numerical': 0.011151515151515152, 'mean_word_length': 2.040530582166544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5993852', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1225, 'n_words': 246}