Command-click to see Swift representation of Objective-C API in Xcode

This thread has been locked by a moderator.

A number of questions asking how to call various Objective-C APIs in Swift, or why overriding certain methods or properties "doesn't work", can be answered just by looking at the Swift representation of the Objective-C API.


In Xcode, simply Command-click on a symbol (such as NSView or UIView) and Xcode will present the corresponding header file as it is represented in Swift, for example:


The API Reference in the documentation also shows both Swift and Objective-C forms:

Up vote post of DTS Engineer
2.5k views