Creating a CoronaView

I am testing with the corona cards trial version and have it integrated into my app.  I am able to create an corona card instance by creating a CoronaViewController, adding it as a child view controller to one of my view controllers and that all works great.

However what I would really like to do is create CoronaView as child view of one of UIViews, not a view controller. So I need to be able to create a CoronaView without creating a CoronaViewController.  If I alloc a CoronaView and init it using initWithFrame I get “ERROR: A shader failed to compile.” If init it using initWithFrame:context: and pass a EAGLContext, the card renders but animations are not running. My lua animations listen to the “enterFrame” event to animate. So it appears that event is not firing.  So it appears that CoronaViewController is doing more than just init a CoronaView instance.

Is it possible to create a CoronaView as a child of a UIView without CoronaViewController?  If so what do I have to do to make it work?

Every CoronaView has to have a CoronaViewController. That’s different from being able to insert a CoronaView as a child of a UIView.

Have you looked at our ChildView sample? This sample  shows how to set the CoronaView as a child view of some other view.  See:  https://github.com/CoronaCards/sample-ios-ChildView

Rob

Thanks for the response Rob.  Yes I did see that example.  As I mentioned earlier I am able to successfully test things using CoronaViewController as a child view controller, same as in the example.

However I was hoping to add a corona view as a subview of one of our custom UIView classes.  That custom UIView class is used in several different view controllers. Don’t really want the custom view to have a reference to its parent view controller in order to add the child view controller.  May need to restructure things a little to support working with a child view controller instead of just a child view. 

Thanks again for the response.

Every CoronaView has to have a CoronaViewController. That’s different from being able to insert a CoronaView as a child of a UIView.

Have you looked at our ChildView sample? This sample  shows how to set the CoronaView as a child view of some other view.  See:  https://github.com/CoronaCards/sample-ios-ChildView

Rob

Thanks for the response Rob.  Yes I did see that example.  As I mentioned earlier I am able to successfully test things using CoronaViewController as a child view controller, same as in the example.

However I was hoping to add a corona view as a subview of one of our custom UIView classes.  That custom UIView class is used in several different view controllers. Don’t really want the custom view to have a reference to its parent view controller in order to add the child view controller.  May need to restructure things a little to support working with a child view controller instead of just a child view. 

Thanks again for the response.