Can't add subview to UiButton

I try to create a custom button with custom subview, but untortunately button appears without this custom subview. public class ButtonWithSubview: UIButton { private var customView = UIView() override public init(frame: CGRect) { super.init(frame: .zero) backgroundColor = UIColor.Player.roundedButtonBackground.withAlphaComponent(0.75) prepareCustomView() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func prepareCustomView() { customView.backgroundColor… Read More Can't add subview to UiButton

Swift UIButton with questionmark

Is it possible to add this button type of button to my project: I remember I’ve heard about bezel, but not sure if that is it? >Solution : Just create a UIButton, and set it’s cornerRadius: button.layer.cornerRadius = 0.5 * button.bounds.size.width button.clipsToBounds = true button.backgroundColor = UIColor.gray

maxWidth infinity failure SwiftUI

I have the following code: Button(action: { }, label: { Text("Save".uppercased()) .foregroundColor(.white) .font(.headline) .background(Color.accentColor) .frame(height: 55) .frame(maxWidth: .infinity) .cornerRadius(10) }) } .padding(14) I’ve checked it over and am clearly missing something because the max width is not working whatsoever. The button is still tightly confined around the "SAVE" text. I have also tried manually adjusting… Read More maxWidth infinity failure SwiftUI