<commit_before>//
//  Label.swift
//  MHAppKit
//
//  Created by <NAME> on 3/3/16.
//  Copyright (c) 2016 <NAME>. All rights reserved.
//

import UIKit

@IBDesignable open class Label: UILabel {
    
    @IBInspectable open var insets: UIEdgeInsets = .zero
    
    @IBInspectable open var topInset: CGFloat {
        
        get { return self.insets.top }
        set { self.insets.top = newValue }
    }
    
    @IBInspectable open var bottomInset: CGFloat {
        
        get { return self.insets.bottom }
        set { self.insets.bottom = newValue }
    }
    
    @IBInspectable open var leftInset: CGFloat {
        
        get { return self.insets.left }
        set { self.insets.left = newValue }
    }
    
    @IBInspectable open var rightInset: CGFloat {
        
        get { return self.insets.right }
        set { self.insets.right = newValue }
    }
    
    open override var intrinsicContentSize : CGSize {
        
        var intrinsicContentSize = super.intrinsicContentSize
        
        if self.text != nil && self.text?.isEmpty == false {
            
            intrinsicContentSize.height += self.insets.top
            intrinsicContentSize.height += self.insets.bottom
            intrinsicContentSize.width += self.insets.left
            intrinsicContentSize.width += self.insets.right
        }
        
        return intrinsicContentSize
    }
}<commit_msg>- Label - drawing now takes insets into account<commit_after>//
//  Label.swift
//  MHAppKit
//
//  Created by <NAME> on 3/3/16.
//  Copyright (c) 2016 <NAME>. All rights reserved.
//

import UIKit

@IBDesignable open class Label: UILabel {
    
    @IBInspectable open var insets: UIEdgeInsets = .zero
    
    @IBInspectable open var topInset: CGFloat {
        
        get { return self.insets.top }
        set { self.insets.top = newValue }
    }
    
    @IBInspectable open var bottomInset: CGFloat {
        
        get { return self.insets.bottom }
        set { self.insets.bottom = newValue }
    }
    
    @IBInspectable open var leftInset: CGFloat {
        
        get { return self.insets.left }
        set { self.insets.left = newValue }
    }
    
    @IBInspectable open var rightInset: CGFloat {
        
        get { return self.insets.right }
        set { self.insets.right = newValue }
    }
    
    open override var intrinsicContentSize : CGSize {
        
        var intrinsicContentSize = super.intrinsicContentSize
        
        if self.text != nil && self.text?.isEmpty == false {
            
            intrinsicContentSize.height += self.insets.top
            intrinsicContentSize.height += self.insets.bottom
            intrinsicContentSize.width += self.insets.left
            intrinsicContentSize.width += self.insets.right
        }
        
        return intrinsicContentSize
    }
    
    open override func drawText(in rect: CGRect) {
        
        super.drawText(in: UIEdgeInsetsInsetRect(rect, self.insets))
    }
}
{'fraction_non_alphanumeric': 0.08965748824714574, 'fraction_numerical': 0.005372733378106112, 'mean_word_length': 1.842557251908397, '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': '783249', 'n_tokens_mistral': 923, 'n_tokens_neox': 895, 'n_words': 206}