Extensions are actually categories without the category name. It’s often referred as anonymous categories.
The methods declared by a class extension are implemented in the implementation block for the original class, so you can’t, for example, declare a class extension on a framework class, such as a Cocoa or Cocoa Touch class like NSString..
@interface ClassName ()
Characteristics of extensions
- An extension cannot be declared for any class, only for the classes that we have original implementation of source code.
- An extension is adding private methods and private variables that are only specific to the class.
- Any method or variable declared inside the extensions is not accessible even to the inherited classes.