Files
2022-05-27 20:21:01 +03:00

42 lines
1.2 KiB
Swift

//
// CommonView.swift
// List
//
// Created by Igor Danich on 27.07.2020.
// Copyright © 2020 List. All rights reserved.
//
import UIKit
@IBDesignable
class CommonView: UIView {
@IBInspectable var cornerRadius: CGFloat {
get { layer.cornerRadius }
set { layer.cornerRadius = newValue }
}
@IBInspectable var borderColor: UIColor? {
get { UIColor(cgColor: layer.borderColor ?? UIColor.clear.cgColor) }
set { layer.borderColor = newValue?.cgColor }
}
@IBInspectable var borderWidth: CGFloat {
get { layer.borderWidth }
set { layer.borderWidth = newValue }
}
@IBInspectable var shadowColor: UIColor? {
get { UIColor(cgColor: layer.shadowColor ?? UIColor.clear.cgColor) }
set { layer.shadowColor = newValue?.cgColor }
}
@IBInspectable var shadowOffset: CGSize {
get { layer.shadowOffset }
set { layer.shadowOffset = newValue }
}
@IBInspectable var shadowRadius: CGFloat {
get { layer.shadowRadius }
set { layer.shadowRadius = newValue }
}
@IBInspectable var shadowOpacity: CGFloat {
get { CGFloat(layer.shadowOpacity) }
set { layer.shadowOpacity = Float(newValue) }
}
}