I’ve 2 buttons. “Shares” one is default, it has bigger measurement and daring, the “Favorites” one is small. When the second is pressed, I would like “Shares” to vary measurement dynamically. I attempted to hardcode, however then realized viewDidLoad() is known as solely as soon as. How can I deal with this?
//MARK: – Shares Button and Favorites Button
stocksButton .setTitle(“Shares”, for: .regular)
activated(button: stocksButton)
favoritesButton .setTitle(“Favorites”, for: .regular)
disabled(button: favoritesButton)
if favoritesButton.isSelected {
disabled(button: stocksButton)
activated(button: favoritesButton)
}
if (stocksButton.isSelected) {
disabled(button: favoritesButton)
activated(button: stocksButton)
}
func disabled(button: UIButton) {
button.setTitleColor(.grey, for: .regular)
button.titleLabel?.font = UIFont.systemFont(ofSize: 18)
}
func activated(button: UIButton) {
button.setTitleColor(.black, for: .regular)
button.titleLabel?.font = UIFont.systemFont(ofSize: 28)
}
// that is in my viewDidLoad() operate