Search code examples
c4

New classes in C4


I am making a new class in C4 and I am wondering what they should inherit from?

The class is a helper classes and not visual, so should it inherit from C4Object instead of C4Control or NSObject (or some other default class)?


Solution

  • Best option for non-visual objects is to inherit from C4Object.

    The C4Object class has all the same functionality of C4Control, except those options for changing any visual state (e.g. origin, borderWidth, animationDuration, etc.). C4Control subclasses should be strictly reserved for visual objects.