I'd like to understand how/where a particular translation of an Objective-C API to Swift is defined. The
used to be imported as
open func print(_ sender: Any?)
in Swift ≤ 3. Apparently in order to avoid conflicts with the global
print() function, the translation changed to
open func printView(_ sender: Any?)
in Swift 4/Xcode 9.
There is a general translation mechanism (described in SE-0005 Better Translation of Objective-C APIs Into Swift), so there are two possibilities:
- There were changes in the general translation mechanism, or
- there is a “custom translation” for this particular API.
My guess would be the custom translation, but I could not find any occurrence of "printView" in the Swift source code. Also there is no NS_SWIFT_NAME annotation on the Objective-C declaration in NSView.h.
I also could not find anything related to this change in the Swift CHANGELOG or the Xcode 9 release notes, but of course I may have overlooked something.
Any insights on how/where this translation works, and what made it change between Swift 3 and Swift 4 are welcome.