Reputation: 51
I am trying to set a button property like this, When i add this code it crashes without even displaying the button i have in the main.storyboard.
let containerScheme = MDCContainerScheme()
cancelButton.applyOutlinedTheme(withScheme: containerScheme)
Upvotes: 0
Views: 1919
Reputation: 817
I faced the same problem. But I was building the UI through code.
import MaterialComponents.MaterialButtons
import MaterialComponents.MaterialButtons_Theming
let button = MDCButton()
button.applyTextTheme(withScheme: MDCContainerScheme())
The following helped me. I just called the option Product -> Clean Build Folder
.
After that, the abnormal termination of the program disappeared.
Upvotes: 1
Reputation: 469
From the error, you can see that UIButton
does not have a method called applyOutlinedThemeWithScheme
, which could mean that in your storyboard or XIB, you are using a UIButton instead of a MDCButton.
In your storyboard or XIB, go to Identity Inspector, make sure Class
is set to MDCButton
.
Upvotes: 0