I have a custom UIButton that I want to redraw after clicking it - I want to change its color. Here is the code:
class DayButtons: UIButton {
var isPressed: Bool = false
var color = UIColor.whiteColor()
override func drawRect(rect: CGRect) {
let cornerR = CGFloat(5)
var path = UIBezierPath(roundedRect: rect, cornerRadius: cornerR)
color.setFill()
path.fill()
}
}
Is it possible to call drawRect in my main thread again?
source
share