Header Files are a special file type that allows the collection of Import and Using Declarations, Operators and Type aliases. They are created with the
.dyvilhfile extension and allow the definition of the above header elements, but not classes. To use header files from within other files, one can include them with the
usingkeyword. This has the same effect as copying the code from the header into the source file:
static func main(args: [String]) -> void
let list: List<String> = new ArrayList<String> // no explicit import required
Header Files differ from other class files in that they are not compiled to
.classfiles, but to an object code representation with the
.dyofile extension. The file type stores all import and using declarations, operator definitions and type aliases in a binary format. This ensures that the entire source code of the Header File (excluding comments) can be rebuilt from the object code.