.APINOTES File Extension
Swift Objective-C API Note
3.8 | 14 Votes
What is an APINOTES file?
An APINOTES file is a metadata file used by a program written in Apple's Swift programming language. It contains annotations for an Objective-C API that the program is accessing. The APINOTES file provides additional semantic information that is not present within the Objective-C API's headers.
Swift is an Apple-maintained programming language that developers use to create programs for macOS, iOS, tvOS, and watchOS. Developers creating Swift programs may have those programs make API calls to programs written in Objective-C, which is the language Swift replaced.
If an Objective-C API's header does not contain all the information needed for the Swift program to correctly interpret information it receives from the API, developers can annotate the API using an APINOTES file. This file contains YAML-formatted text that defines how and what information a Swift program can receive from the associated Objective-C API.
After a developer creates an APINOTES file, they must place it in the same directory as the Objective-C framework to which it corresponds and update CMakeLists.txt. Then, the next time the developer builds their Swift program, the compiler will load the APINOTES file along with the corresponding framework.
How to open an APINOTES file
You can open and edit an APINOTES file in any text or source code editor, such as GitHub Atom, Sublime Text, or Microsoft Visual Studio Code. Source code editors, like the previously mentioned programs, contain tools that make it easier to review and edit the text APINOTES files contain.