views:

152

answers:

1

I have a complex view which is composed of a base image overlaid with other images and 2D paths.

I wonder what difference will it make if a assemble the complex view by creating a different UIView for each element and adding them as children of the complex view or if I should instead create a a different CALayer for each element and add them as children of the complex view's layer property.

Thanks

tat0

A: 

You should elaborate on what you're trying to do, but my rule of thumb is to use UIViews for cases where I am trying to enhance the user interface (user interaction, etc.), and I use layers when I am wanting to animate something or use sprites. It sounds like you are doing the latter, so I would suggest adding new layers to your main view instead of adding sub views.

Matt Long