I am trying to add a delegate to a CALayer so I can know when the animation sequence is complete. It’s animating 40 sublayers around the screen. Once I add the delegate as I do below, all the animation stops on the CALayer.
Here is my code:
@protocol NIArticlesLayerDelegate;
@interface NIArticlesLayer : CALayer {
id<NIArticlesLayerDelegate> delegate;
}
@property (nonatomic, assign) id<NIArticlesLayerDelegate> delegate;
@end
@protocol NIArticlesLayerDelegate <NSObject>
@optional
-(void)itemAtCenter:(id)item;
@end
Checking the CALayer Docs,
CALayeralready has a property called delegate which MUST be assigned to the owning view. Try changing the name?