You can easily use cocos2d to render Open GL content with a transparent background on UIKit views. The most common use for this type of behaviour would be to implement Augemented Reality applications which display an overlay view on top of the camera using UIImagePickerController.
Just open CCDirector.m and look for the selector [CCDirector initGLDefaultValues]. Here's the code you can use to make the EAGLView render a transparent background:
-(void) initGLDefaultValues
{
// This method SHOULD be called only after openGLView_ was initialized
NSAssert( openGLView_, @"openGLView_ must be initialized");
[self setAlphaBlending: YES];
[self setDepthTest: YES];
[self setProjection: CCDirectorProjectionDefault];
// ***** NEW CODE: make open gl view transparent
openGLView_.opaque = NO;
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// disable regular, opaque clear color
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
// ***** NEW CODE end
#if CC_DIRECTOR_FAST_FPS
if (!FPSLabel)
FPSLabel = [[CCLabelAtlas labelAtlasWithString:@"00.0" charMapFile:@"fps_images.png"
itemWidth:16 itemHeight:24 startCharMap:'.'] retain];
#endif
}
As riq correctly pointed out, you can also make these adjustments outside of CCDirector by obtaining a reference to the EAGLView via [CCDirector openGLView] and setting its opaque property.