UITextField drawRect is not invoked in iOS 14 devices

Hi Team,

We have application with custom drawing and it is working in <iOS 14 beta devices and When I ran the sample on iOS 14 beta devices, I have observed drawRect is not called.

I have created sample application. Please let me know what is changed here.

Thanks,
Pallam Madhukar

Replies

Yes, I'm facing the same problem.
Reported behaviour to apple, Here is the Apple engineering team feedback:


Engineering has provided the following information regarding this issue:
drawRect: is not intended to be an override point for UITextField. If you're intending to override the look of a UITextField, we suggest >you assign a UIImage to the background property.

Hope this helps
It seems the signature of the draw function has changed, I was able to get it working by overriding the following:

   override func drawText(in rect: CGRect){

}