Swift - How to auto-capitalize the label of a UIButton?
You need to set title
of button, not titleLabel
's text directly. updated your code as follows:
override func didMoveToWindow() {
self.setTitle(self.title(for: .normal)?.uppercased(), for: .normal)
}
This code is working for me, I hope this will help you.