Question

I have 2 classes:

  • XCALayer derived from CALayer
  • XCATextLayer derived from CATextLayer

I've created XCALayer+FrameMucking.h category that allows me easily adjust XCALayer's frame. The thing is that I would like to use it also for XCATextLayer, but without duplicating all the code. Is it possible to use my category for both XCALayer and XCATextLayer?

Was it helpful?

Solution

If you are just changing the frame of XCALayer and XCATextLayer you should be able to add a category to CALayer since frame is a property of CALayer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top