Skip to content

Commit 19572e2

Browse files
committed
Make isOpaque parameter for UIButton background color controllable
1 parent 8b3c72e commit 19572e2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Sources/InstrumentsUI/Extensions/UIButton+InstrumentsUI.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
import UIKit
2626

2727
extension UIButton {
28-
public func setBackgroundColor(_ color: UIColor?, for state: UIControl.State) {
29-
setBackgroundImage(color.flatMap { .fromColor($0) }, for: state)
28+
public func setBackgroundColor(
29+
_ color: UIColor?,
30+
isOpaque: Bool = true,
31+
for state: UIControl.State
32+
) {
33+
setBackgroundImage(color.flatMap { .fromColor($0, isOpaque: isOpaque) }, for: state)
3034
}
3135
}

0 commit comments

Comments
 (0)