From 4fac0e4591fd57865d444a945a26de60a9b72a5a Mon Sep 17 00:00:00 2001 From: Yurim Kim Date: Thu, 24 Oct 2024 19:37:29 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#6=20-=20configureButton=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20(contentI?= =?UTF-8?q?nsets)=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Week2/Extensions/UIButton+Extension.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/35-seminar/Presentation/Week2/Extensions/UIButton+Extension.swift b/35-seminar/Presentation/Week2/Extensions/UIButton+Extension.swift index 9dc8ddc..ef08147 100644 --- a/35-seminar/Presentation/Week2/Extensions/UIButton+Extension.swift +++ b/35-seminar/Presentation/Week2/Extensions/UIButton+Extension.swift @@ -22,6 +22,7 @@ extension UIButton { cornerStyle: UIButton.Configuration.CornerStyle? = nil, foregroundColor: UIColor = .tintColor, backgroundColor: UIColor = .clear, + removeContentInsets: Bool = false, for state: UIControl.State = .normal) { var config = { @@ -52,6 +53,10 @@ extension UIButton { config.baseForegroundColor = foregroundColor config.baseBackgroundColor = backgroundColor + if removeContentInsets { + config.contentInsets = .zero + } + self.configuration = config } }