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?
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?
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.
Memory and ARCMultiple choiceExpert
Which statement about Swift 5.9's ownership features (borrowing/consuming parameters…
#ownership #swift-5.9
SwiftShort answerExpert
A Swift module has to call into legacy Objective-C code and be called from it. How do you…
#bridging
SwiftShort answerAdvanced
Say your resume claims "ContiguousArray is faster than Array." In a pre-interview the…
#bridging
Memory and ARCShort answerAdvanced
Starting from "explain ARC," the follow-ups keep coming. First: who inserts retain and…
#ownership