Does #import <UIKit/UIKit.h> on pch slow down the compile time?

Raphael Oliveira picture Raphael Oliveira · Sep 26, 2013 · Viewed 9k times · Source

I was reading this post about imports and I had one question. Does the #import that comes in the prefix.pch file by default slow down the compile time? Should I remove it and import only when necessary?

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

Answer

Ratikanta Patra picture Ratikanta Patra · Sep 26, 2013

No. It actually improves the compilation speed.

This is a nice tutorial that actually clears all the confusion over use of #import statements and .PCH files. Also it tells you in detail about something new known as "modules", introduced in iOS7.