Transitioning From Objective C to Swift in 4 Steps
Article Summary
Gergely Orosz from Skyscanner reveals how his team went from 0% to 100% Swift adoption in just 8 months—without rewriting a single line of working Objective-C code. Here's their battle-tested playbook.
Skyscanner started building TravelPro in Objective-C in March 2015, then pivoted to Swift 2.0 months later. By November 2015, every new feature was Swift-only. This article breaks down their incremental migration strategy that kept velocity high while modernizing a 65,000-line codebase.
Key Takeaways
- Started with isolated UI controls and utility functions to minimize risk
- Added nullability annotations to Objective-C headers for Swift interop
- Abandoned OCMock for explicit dependency injection and custom mocks
- Protocol-oriented programming made code more testable and loosely coupled
- 10% of codebase converted to Swift without slowing feature delivery
Skyscanner successfully transitioned to 100% Swift for new code by taking an incremental approach that improved architecture without the risk or cost of a full rewrite.
About This Article
When Skyscanner's team started writing Swift code, they ran into a problem. Swift didn't have mocking frameworks like OCMock, so unit testing was nearly impossible without first restructuring the implicit dependencies buried in their Objective-C codebase.
They adopted explicit dependency injection patterns and built custom mock objects instead. This forced them to decouple the code by implementing protocols that could be swapped in as test doubles.
The new Swift codebase ended up noticeably more loosely coupled than the old Objective-C code. Testing became easier, and they didn't have to sacrifice development speed to get there.