0

Thanks to the answer provided here -- Programmatically create a UIView with color gradient -- I am able to set a color gradient for the background of the homescreen of my app.

Prior to programming the color gradient using a CAGradientLayer, the user would press a button on the homescreen, and my SCNScene would appear.

Now, with the gradient in place, I can't seem to get the SCNScene to appear. All I can see is the color gradient. I've tried constructing an SCNLayer "above" the CAGradientLayer, but XCode yells at me.

What gives? Shouldn't it be simple to display a CAGradientLayer in the background with an SCNScene in front of it? I'm relatively new to this - thanks in advance.

Community
  • 1
  • 1
Harrison
  • 69
  • 9
  • if Xcode gives you an error, it would be useful to see it. – mnuages Aug 06 '15 at 10:39
  • It doesn't recognize the object - SCNLayer @mnuages – Harrison Aug 06 '15 at 15:16
  • `SCNLayer` only exists on OS X, is it an iOS project? If so you can use `SCNView` which is always layer-backed and can be placed on top of any other view. – mnuages Aug 06 '15 at 15:39
  • Ah wow thanks I missed that in the docs somehow. Yep it's an iOS project. I'll fool around with just using SCNView. Wish I could accept your comment somehow – Harrison Aug 06 '15 at 15:54

1 Answers1

1

SCNLayer only exists on OS X, is it an iOS project? If so you can use SCNView which is always layer-backed and can be placed on top of any other view.

mnuages
  • 13,049
  • 2
  • 23
  • 40