GADBannerView on SCNPlane possible?

54 Views Asked by At

I'm trying to display a GADBannerView in a SCNPlane. Code looks more or less like this:

let banner = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
banner.rootViewController = self
banner.load(GADRequest())

let viewMaterial = SCNMaterial()
viewMaterial.diffuse.contents = bannerView

let plane = SCNPlane(width: 320, height: 50)
plane.materials = [viewMaterial]

let planeNode = SCNNode(geometry: plane)
planeNode.position = SCNVector3(0, 5, -10)

sceneView.scene.rootNode.addChildNode(planeNode)

This kind of works but the banner is displayed like this, i guess the GADBannerView has some transparent stuff going on which is not handled correctly: enter image description here

Is this even possibly? If yes how, if not why not. ;)

1

There are 1 best solutions below

2
mnuages On

Displaying UIView hierarchies as the contents of a SCMaterialProperty is not documented and not supported.