Daily iOS
Swift

Objective-C interop

A Swift module has to call into legacy Objective-C code and be called from it. How do you set up bridging in both directions?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

ObjC to Swift goes through the bridging header; Swift to ObjC goes through the generated -Swift.h header. Only @objc members on NSObject-based types are visible to ObjC.

Share a question