<commit_before>//
//  UIVIew+Comet.swift
//  Comet
//
//  Created by Harley on 2016/11/8.
//
//

import Foundation

public extension UIView {
    
    @IBInspectable var cornerRadius: CGFloat {
        get {
            return self.layer.cornerRadius
        }
        set {
            self.layer.cornerRadius = newValue
        }
    }
    
    @IBInspectable var borderWidth: CGFloat {
        get {
            return self.layer.borderWidth
        }
        set {
            self.layer.borderWidth = newValue
        }
    }
    
    @IBInspectable var borderColor: UIColor? {
        get {
            if let color = self.layer.borderColor {
                return UIColor(cgColor: color)
            }
            return nil
        }
        set {
            self.layer.borderColor = newValue?.cgColor
        }
    }
}


public extension Bundle {
    
    
    /// 从 xib 文件创建视图
    ///
    /// - Parameter name: xib 文件名，默认为指定视图类名
    public func createView<T: UIView>(_ name: String? = nil) -> T {
        let nibName = name ?? T.classNameWithoutModule
        let view = loadNibNamed(nibName, owner: nil, options: nil)![0] as! T
        return view
    }
}

<commit_msg>通过 Bundle 的 createView 快捷方法创建 UIView 支持传入 owner 以及 Options 参数<commit_after>//
//  UIVIew+Comet.swift
//  Comet
//
//  Created by Harley on 2016/11/8.
//
//

import Foundation

public extension UIView {
    
    @IBInspectable var cornerRadius: CGFloat {
        get {
            return self.layer.cornerRadius
        }
        set {
            self.layer.cornerRadius = newValue
        }
    }
    
    @IBInspectable var borderWidth: CGFloat {
        get {
            return self.layer.borderWidth
        }
        set {
            self.layer.borderWidth = newValue
        }
    }
    
    @IBInspectable var borderColor: UIColor? {
        get {
            if let color = self.layer.borderColor {
                return UIColor(cgColor: color)
            }
            return nil
        }
        set {
            self.layer.borderColor = newValue?.cgColor
        }
    }
}


public extension Bundle {
    
    
    /// 从 xib 文件创建视图
    ///
    /// - Parameter name: xib 文件名，默认为指定视图类名
    public func createView<T: UIView>(_ name: String? = nil, owner: Any? = nil, options: [AnyHashable : Any]? = nil) -> T {
        let nibName = name ?? T.classNameWithoutModule
        let view = loadNibNamed(nibName, owner: owner, options: options)![0] as! T
        return view
    }
}


{'fraction_non_alphanumeric': 0.0957962813257882, 'fraction_numerical': 0.0064672594987873885, 'mean_word_length': 1.5229357798165137, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4658416', 'n_tokens_mistral': 816, 'n_tokens_neox': 804, 'n_words': 183}