Change disable grey tint color button image swift 4

I want to disable tint color image in button, and I try some method like 

let btnImage = myImage.withRenderingMode(.alwaysTemplate) 
myButton.setImage(stencil, for: .normal) 
myButton.tintColor = UIColor.white 

I tried like above but not what I expected, and use extention too but the results are same.


I'm trying to change the button image color white when it's disabled. To mention that my button may be also enabled, but a tint color is it's always grey.

finally I tried to set the xib file.


and finally it worked, I also included debugging the area as proof that it worked.







No comments: