//
//  UIViewX.swift
//  Zockerhoehle
//
//  Created by Julian-Steffen Müller on 22.09.18.
//  Copyright © 2018 Julian-Steffen Müller. All rights reserved.
//

import Foundation

//
//  UIButtonStoryBoardExtenstion.swift
//  Zockerhoehle
//
//  Created by Julian-Steffen Müller on 22.09.18.
//  Copyright © 2018 Julian-Steffen Müller. All rights reserved.
//

import UIKit
import Foundation

@IBDesignable class UIViewX : UIView {
    
    @IBInspectable var borderWidth: CGFloat {
        set {
            layer.borderWidth = newValue
        }
        get {
            return layer.borderWidth
        }
    }
    
    @IBInspectable var cornerRadius: CGFloat {
        set {
            layer.cornerRadius = newValue
        }
        get {
            return layer.cornerRadius
        }
    }
    
    @IBInspectable var borderColor: UIColor? {
        set {
            guard let uiColor = newValue else { return }
            layer.borderColor = uiColor.cgColor
        }
        get {
            guard let color = layer.borderColor else { return nil }
            return UIColor(cgColor: color)
        }
    }
}

