2

I am using an MDCButton with a storyboard, how can I set the text color when the button is pressed (or in a highlighted state). I am using MDCSemanticColorScheme to set the color scheme of the button. Basically I need to contrast the titleColor with the inkColor.

Code of the button being initialised from Storyboard : -

import UIKit
import MaterialComponents

class LightButton: MDCButton {

  override func draw(_ rect: CGRect) {
    MDCButtonColorThemer.applySemanticColorScheme(Theme.lightColorScheme(), to: self)
    inkColor = Color.brandLightColor
  }

}
aprofromindia
  • 1,111
  • 1
  • 13
  • 27

0 Answers0