Objective-C Interop
Sometimes it is necessary to write a Swift class or function that is accessible by Objective-C code. For this, we have a pattern that allows us to keep everything important in Swift Land, only using a thin wrapper to expose our code to Objective-C Land. This has the added benefit of keeping all code that ties us to Objective-C contained, so as we move away from it, the only changes that must be made to Swift files are deleting these thin wrappers.
Good | Bad |
---|---|
|
|
EXCEPTION Assuming their counterparts are well-documented and easy to find, it is OK to not document these thin
__objc__
wrappers.