In C and Objective-C, you have a separate interface file (.h) and implementation (.c, .m).
- An interface file provides a quick overview of all the methods and properties of this class that are available for other code (when importing an interface file). This is similar to the index of a book chapter.
- Implementation , on the other hand, is where the code of the actual method is written.
In Swift , on the other hand, there is no such difference, and classes are automatically available for all of your code. Of course, the advantage is that the number of source files in your project is approximately halved, and you do not need to go back and forth between the interface file and the implementation file during encoding (all this is βin one placeβ,).
So, to make up for the lack of "only an interface" (for example, headers in C / Objective-C), Xcode generates one on the fly just to show you the available methods and properties of this class. You will notice that there are no method objects, as well as properties and methods declared private (because they are not accessible outside the class, therefore, by definition they are not part of the "interface").
This is not a real file that is located anywhere on your file system (as far as I know).
source share