small medium large xlarge

Generic-user-small
29 Oct 2014, 13:00
arthur choi (1 post)

I am trying to understand:

  • (instancetype)plunger {

    RCWPlungerNode *plunger = [self node]; plunger.size = CGSizeMake(20, 100);

The RCWPlugerNode has an extra property, size. How does the [self node] statement return an instance of the subclass?

Generic-user-small
20 Apr 2015, 20:31
Joshua Smith (6 posts)

the node method is a class method on the SKNode class. The RCWPlungerNode is a subclass of SKNode and gets that method from the parent class.

You must be logged in to comment