There are a couple of ways worth looking at to do this.
One is to look at view containment instead of layering — make the GLKView
a subview of the view you're drawing a UIImage
in.
The other is to draw the image in your GLKView
using OpenGL ES. It's a little more work, but not too hard if you look over the documentation and the answers already here on SO. And it has some extra benefits: since both the background image and your drawing are going into the same framebuffer, you can control blending in GL. Here's some tips for getting started:
- Use
GLKTextureLoader
to get your image into an OpenGL ES texture. - Set up a
GLKBaseEffect
instance for drawing with your texture. Don't forget to tell it toprepareToDraw
. - Draw a quad using the texture and effect. This answer has a pretty decent starting point for doing that.
- After drawing the background image, draw your signature and it'll be on top of the image.