1

I saw an answer where a user mentioned replacing the CALayer class for a UIView. https://stackoverflow.com/a/17558724/998117

But if I add that property, I get

Auto property synthesis will not synthesize property 'layer'; it will be implemented by its superclass, use @dynamic to acknowledge intention.

How should I be replacing this?

Community
  • 1
  • 1
Doug Smith
  • 29,668
  • 57
  • 204
  • 388

1 Answers1

0

The error message/warning that you're getting is telling you that you've declared a property called *layer , but you are already inheriting a property with the same name. So you can eliminated this warning by doing what it says, insert @dynamic layer at the start of your implementation, or just remove the declaration of this *layer property and use the existing one.

You can change the layer that a UIView subclass automatically creates by overriding

-(class)layerClass

And returning your own subclass of CALayer.

Best

Jef
  • 4,728
  • 2
  • 25
  • 33