In the Overview of Apple's documentation for NSApplication, there are code examples in Objective C although I chose Swift in the upper right corner.
https://developer.apple.com/documentation/appkit/nsapplication
I can't quite make sense of this. Am I missing some important aspect or is it a pure mistake in the documentation?