Using C, C++ and Objective C frameworks in Swift apps
summary
Shows concrete recipes and working demos: dragging vanilla objc framework into Xcode, linking a simple cpp wrapper that calls libbasiccpp.a, and exposing a static pure C library via a modulemap folder so Swift can import headers. Covers real pitfalls and fixes — pointer ownership and calling free, casting Int to Int32, C function-pointer vs Swift closure lifetime, wrapping C++ objects with new/delete, and converting macros into typed functions so the code actually runs.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:48Storytime
- 4:19Object C framework
- 5:29C dependencies
- 6:46C modules
- 9:28The easy way
- 11:26Manual memory management
- 12:13Function pointer
- 15:41C
- 16:26CPP
- 17:12Macro
- 17:43Conclusion
related talks
25mUse C, C++ and Objective C Libraries in a Swift Project
45mUsing C Libraries in Swift 3
04mSupporting Objective-C in a Swift codebase
40mFeet in Both Worlds: From Objective-C to Swift
53mSwift: New Paradigms for iOS Development
19mJust Enough Objective-C
47mSwift Glue Code
45mSwift 5.9: Exploring Interop and an Arranged Marriage with C++
