'UITextView emoji background issue

I have an UITextView extension with emoji enabled and when I switch to the emoji keyboard the emoticons have a white background. I tried to update the UITextView background color, I removed the custom attributes from my extension and I also used a default UITextView but the white background is always there. When I click on an emoticon it is correctly shown into the UITextView without the white background. What could be the cause of this?

This is the screenshot of the soft keyboard

enter image description here



Solution 1:[1]

I found the cause of this. I post this here in case someone has the same problem. I was setting

UICollectionViewCell.appearance().backgroundColor = .white

Because the appearance was set globally and the keyboard emoticons are of type UICollectionViewCell, the white background was shown for each cell.

Since I have a custom extension for my UICollectionViewCells, I changed the previous line to

MyCollectionViewCell.appearance().backgroundColor = .white

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1