Setting UIView as SCNNode’s material content.

Hello,


I have multiple SCNNode objects with Box or Plane geometries, with UIViews set as their materials. The first issue I’m experiencing is: those views sometimes become blank.

That happens when I’m setting UIView as material on application start or in runtime. I noticed that the more there are objects with views as materials on the scene, the more frequently this bug appears. How can this be avoided?


Second issue is related with alpha channel of those views - when I change the alpha of the view's background that’s being set as a material, alpha changes normally, but it seems like the view has an extra “layer” underneath it, that’s always white. Because of that it’s impossible to make view transparent. How can I set the transparency of the material’s view's background, without changing the opacity of the node? For example: I want to set a collection view as SCNNode's material, and make cells visible, while background being transparent.


P.S. Also I noticed that the views, that are being set as materials, appear as _SCNSnapshotWindow instances in View Hierarchy mode. I tried changing the alpha of this window and setting background color as clear color, that didn’t help.