Supporting Objective-C in a Swift codebase
summary
GitHub shows roughly 100k vs 70k pull requests and Stack Overflow reports ~6.5% usage for both Swift and Objective C, so interoperability matters. Presents concrete workarounds: expose an NSNumber-backed @objc property as an Objective‑C fallback for an Int? optional, add Objective‑C unit tests to catch unbridgeable APIs, and enforce a custom linter rule that warns when protocols, enums, generics or structs are not bridgeable. Each item is actionable and verifiable in the codebase.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 0:26Why you should care
- 0:40ObjectiveC vs Swift
- 1:36ObjectiveC fallback
- 2:36ObjectiveC unit tests
- 3:07linter rule
related talks
40mFeet in Both Worlds: From Objective-C to Swift
19mUsing C, C++ and Objective C frameworks in Swift apps
19mJust Enough Objective-C
37mBeyond Xcode
49mEffective Kotlin-Swift Interoperability
41mThe Kotlin Swift boundary
25mUse C, C++ and Objective C Libraries in a Swift Project
58mSwift: safety, ergonomics, productivity and legacy preservation
