On iOS, every UIView is supported by CALayer Core Animation, so you use CALayers when using UIView, even if you don't understand it. Unlike NSViews on the Mac, which evolved to Core Animation, UIViews had light wrappers around these CALayers.
As I describe in a similar question, "When to use CALayer on Mac / iPhone?" , working with CALayers does not give you significant performance advantages of UIViews. One of the reasons you might need to create a user interface element with CALayers instead of UIViews is that it can be easily ported to Mac. UIViews are very different from NSViews, but CALayers are almost identical on two platforms. This is why the Core Plot framework exposes its graphs using CALayers instead of other user interface elements.
One thing that UIViews provides over CALayers is the built-in user experience support. They handle hit tests and other related activities that you will need to create yourself if you manage the CALayers hierarchy. It is not so difficult to implement this on your own, but this is additional code that you need to write when creating the CALayer interface.
You will often need access to the base layers for the UIView when performing more complex animations than the UIView base class allows. UIView's animation capabilities have grown as the iOS SDK ripens, but there are a few more things that are best done by interacting with the base CALayer.
Brad Larson Oct 19 '11 at 20:08 2011-10-19 20:08
source share