Writing Your First TurboModule in Swift

React Native’s New Architecture makes TurboModules the default path for extending functionality. In this tutorial, Oskar walks through the full workflow: bootstrapping the project, exploring Codegen output, writing the Swift implementation, adding an Objective‑C bridge, and verifying the module inside a real app.
Bootstrapping the library with React Native Builder Bob
Oskar starts by creating an Expo project and using Builder Bob to scaffold a TurboModule library. This generates platform folders, a starter TypeScript spec, and default native code. Highlight the moment where he swaps the default multiply method for the Local Storage API (setItem, getItem, removeItem, clear).
Understanding the TypeScript spec and Codegen contract
The TypeScript spec defines the contract between JS and native. Codegen reads this file during pod install to produce Objective‑C/C++ headers that ensure type‑safe communication. Oskar shows where these headers live in Xcode and how they directly mirror the TypeScript definitions.
Navigating generated code in Xcode
Once expo prebuild and pod install run, the iOS folder appears with generated native targets. Oskar demonstrates how to locate the TurboModule inside the Pods hierarchy and why Xcode must build once before symbols resolve.
Implementing the business logic in Swift
The core logic lives in Swift: a NativeLocalStorage class backed by UserDefaults with a custom suite name. Oskar walks through the implementation of each method, including potential pitfalls (Swift types unsupported by Objective‑C).
Bridging Swift to Objective‑C
TurboModules require an Objective‑C layer. Oskar shows how to import the generated Swift header, create an instance variable, initialize it in init, and forward calls from Objective‑C into Swift. He discusses why attributes like @objcMembers are required for visibility.
Testing the TurboModule in an Expo application
The episode concludes with adding simple UI buttons that call the TurboModule from JavaScript. Oskar demonstrates setting a value, retrieving it, and verifying persistence via breakpoints in Xcode.
Resources
- Oskar Kwaśniewski on X and GitHub
- Other episodes in this series
- Tools & libraries:
- React Native Builder Bob
- Expo (for prebuild + testing)
- TurboModules (New Architecture)
- Codegen
Learn more about React Native
Stay up to date with our latest insights on React, React Native, and cross-platform development from the people who build the technology and scale with it daily.
Learn more about React Native

React Native Wrapped 2025: A Month-by-Month Recap of The Year
The first edition of React Native Wrapped looks back at the year RN turned 10 and the ecosystem doubled down on the New Architecture. It provides a month-by-month record of 2025, covering major framework releases, the Legacy Architecture freeze, React 19 integration, and notable developments across tooling, performance, styling, native modules, Expo, and platform adoption.

Building v0 iOS and Fixing React Native Along the Way
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Shipping iOS Live Activities with React: The Voltra Story
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Scaling React Native at Zalando: How Brownfield Migration Paid Off
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.












