I have task to make simple app from three Views:
- in first: UITableView (it needs to be first View when app starts)
- in second: UITextField
- in third: Cocos2d Layer
And maybe one more View for menu to switch between them. How can I mix ViewControllers and Layers in one project? Do i need start project from Xcode or Cocos2d template?
One possible approach is starting with a Cocos2D project and then using CCUIViewWrapper to display any view as a
CCNode. This approach is the best one if you can handle all of your views inside of the same Cocos2D scene.If you are planning of building, e.g., a navigation controller based app, then the opposite strategy could be more adequate: start with a “normal” app and then, when you need it (i.e., in your third view controller), add Cocos2d’s GLView to your view controller view:
or:
You will need to import QuartzCore/QuartzCore.h to be allowed to use CALayers.