// // CircleView.swift // Sirani // // Created by Anhar Solehudin on 10/11/20. // Copyright © 2020 Anhar Solehudin. All rights reserved. // import UIKit @IBDesignable class CircleView: UIView { override func layoutSubviews() { super.layoutSubviews() if (frame.width != frame.height) { NSLog("Ended up with a non-square frame -- so it may not be a circle"); } layer.cornerRadius = frame.width / 2 layer.masksToBounds = true } }