Daily iOS
Swift

Using a C++ library

You need to use a C++ video-processing library from a Swift app. Would you go with the old approach (an Objective-C++ wrapper) or Swift 5.9's C++ interop?

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

The traditional approach wraps the C++ in a .mm (Objective-C++) wrapper class and exposes only an Objective-C interface to Swift; since Swift 5.9, a modulemap plus -cxx-interoperability-mode=default lets Swift import C++ types and functions directly. Small surface, use the wrapper; large surface with performance needs, use interop.

Share a question