From 682784a63b6e6f2eb6d33cb3cc2faddc27c863df Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Fri, 18 Feb 2022 18:28:50 +0100 Subject: [PATCH] =?UTF-8?q?fix(helper):=20uibutton=20circle=20fix=20?= =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waosSwift/lib/helpers/UITricks.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/waosSwift/lib/helpers/UITricks.swift b/waosSwift/lib/helpers/UITricks.swift index 84acb8d..a637754 100644 --- a/waosSwift/lib/helpers/UITricks.swift +++ b/waosSwift/lib/helpers/UITricks.swift @@ -9,10 +9,11 @@ import UIKit */ /** -* @desc make circular view, must be called in override func layoutSubviews -* @param {UIView} _view, +* @desc make CircleUIButton */ -func makeCircular(_ view: UIView) { - view.layer.cornerRadius = view.bounds.size.width / 2.0 - view.clipsToBounds = true +class CircleUIButton: UIButton { + override func layoutSubviews() { + super.layoutSubviews() + layer.cornerRadius = bounds.height / 2 + } }