Skip to content

Commit

Permalink
[Feat] #6 - configureButton 함수 기능 추가 (contentInsets)
Browse files Browse the repository at this point in the history
''
  • Loading branch information
yurim830 committed Oct 24, 2024
1 parent 8caf1f2 commit 4fac0e4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -52,6 +53,10 @@ extension UIButton {
config.baseForegroundColor = foregroundColor
config.baseBackgroundColor = backgroundColor

if removeContentInsets {
config.contentInsets = .zero
}

self.configuration = config
}
}

0 comments on commit 4fac0e4

Please sign in to comment.