Changing the default layer used by UIView in iOS

How to do it ?
+(Class)layerClass {
    return [CAEAGLLayer class] or [CAMetalLayer class];


Why should you do it ?

  • Your view draws content using Metal or OpenGL ES, in which case you would use a CAMetalLayer or CAEAGLLayer object.
  • There is a specialized layer class that offers better performance.
  • You want to take advantage of some specialized Core Animation layer classes, such as particle emitters or replicators.


Leave a Reply

Your email address will not be published. Required fields are marked *