skip to Main Content

Ios swift – How to disable title color change when highlighted state for UIButton using UIButtonConfiguration is active?

This is how my UIButton is defined and initialized: lazy var addButton: UIButton = { let button = UIButton(radius: 32, title: "+", font: .poppinsRegular.withSize(40), backgroundColor: .purple) button.menu = UIMenu(title: "") button.showsMenuAsPrimaryAction = true return button }() extension UIButton { convenience…

VIEW QUESTION

Ios swift – How to underline title with UIButton.Configuration?

This is my convenience init for UIButton: convenience init(underlinedTitle: String, font: UIFont, color: UIColor) { var configuration = UIButton.Configuration.plain() configuration.title = underlinedTitle configuration.titleTextAttributesTransformer = UIConfigurationTextAttributesTransformer { incoming in var outgoing = incoming outgoing.font = font outgoing.foregroundColor = color outgoing.underlineStyle =…

VIEW QUESTION

Ios swift – How to use a string in a function name

I have these functions: private func chooseOfferButton1Tapped() { let vc = ChooseRdvVC() vc.offerCatched = arrayCatched![0] HapticsManager.shared.vibrate(for: .success) navigationController?.pushViewController(vc, animated: true) } private func chooseOfferButton2Tapped() { let vc = ChooseRdvVC() vc.offerCatched = arrayCatched![1] HapticsManager.shared.vibrate(for: .success) navigationController?.pushViewController(vc, animated: true) } ... up…

VIEW QUESTION
Back To Top
Search