Forward declaration is just to silence the compiler that this class exists, but it has no idea about its members, methods, properties, size…
Suppose a condition
It basically tells the compiler that the class RootViewController exists, without specifying what exactly it looks like (ie: its methods, properties, etc). You can use this to write code that includes RootViewController member variables without having to include the full class declaration.
#import <UIKit/UIKit.h> @class RootViewController; @interface MyAppDelegate . . .
This is particularly useful in resolving circular dependencies – for example, where say ClassA has a member of type ClassB*, and ClassB has a member of type ClassA*. You need to have ClassB declared before you can use it in ClassA, but you also need ClassA declared before you can use it in ClassB. Forward declarations allow you to overcome this by saying to ClassA that ClassB exists, without having to actually specify ClassB’s complete specification.