Caps-iOS/Caps/View Components/RoundedImageView.swift

32 lines
620 B
Swift
Raw Normal View History

2018-08-16 11:18:27 +02:00
//
// RoundedImageView.swift
// CapFinder
//
// Created by User on 22.04.18.
// Copyright © 2018 User. All rights reserved.
//
import UIKit
class RoundedImageView: UIImageView {
@IBInspectable var borderColor: UIColor = UIColor.black {
didSet {
layer.borderColor = borderColor.cgColor
}
}
@IBInspectable var borderWidth: CGFloat = 0 {
didSet {
layer.borderWidth = borderWidth
}
}
override func layoutSubviews() {
super.layoutSubviews()
layer.cornerRadius = layer.frame.height / 2
clipsToBounds = true
}
}