32 lines
620 B
Swift
32 lines
620 B
Swift
//
|
|
// 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
|
|
}
|
|
}
|