Endless loop when adding CATiledLayer to UIView

I have a UIView in which I add a CATiledLayer and implement 'drawLayer'. If I use the UIViewController and add a layer to the new controller subzone, then everything is fine.

If, however, I try to use UIView and do all the tricks and drawings inside this, then I get an infinite loop at the point shown below when I add this view to the supervisor.

0x002cfafb  <+0425>  ja     0x2cfa23 <-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]+209>

What am I missing?

Update: By removing 'layer.delegate = self', the code no longer crashes ...

+3
source share

Source: https://habr.com/ru/post/1740010/


All Articles