Smooth Migration: Objective C to Swift and Enhancing Stability
19842
post-template-default,single,single-post,postid-19842,single-format-standard,bridge-core-3.0.8,qode-quick-links-1.0,qode-page-transition-enabled,ajax_fade,page_not_loaded,,qode-title-hidden,qode-child-theme-ver-1.0.0,qode-theme-ver-29.5,qode-theme-bridge,disabled_footer_bottom,qode_advanced_footer_responsive_1000,qode_header_in_grid,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Smooth Migration: Objective C to Swift and Enhancing Stability

Our client, a San Francisco-based start-up, wanted to migrate their large Objective C codebase to Swift while at the same time maintaining ongoing development. We all know how complex this migration is. Nevertheless, they contacted us and through meticulous planning, gradual migration, and comprehensive testing, we ensured a smooth transition, while also improving application stability.

 

An overview:

Project duration10 Months
Team size6 people
IndustryOffice management
TechnologyiOS development
Project goalMigrate codebase from Objective C to Swift, while continuing development and adding new features to the project.
Challenges
  • Codebase size
  • Limited time frame
  • Partial test coverage
  • Moving target
ResultsWell-planned gradual codebase migration while ensuring stability through a mix of unit, integration, and UI testing.
Technologies and tools used on the project
  • Objective C
  • Swift
  • Masonry
  • SnapKit
  • REST API client
  • Alamofire
  • Mantle
  • OHHTPStubs
  • OCMock
  • Nimble
  • CocoaLumberjack
  • Firebase
  • Instabug
  • Crashlytics
  • CircleCI
  • AWS

 

About the Client

Our client is a start-up company working in the area of office management and work process automation.

 

Project Goals

Project codebase migration from Objective C to Swift including CI/CD changes while ensuring the project remains fully functional and operational throughout the migration process.

Codebase migration

The company had a large codebase in Objective C, that needed to be rewritten in Swift. Migration from Objective C to Swift is undertaken to modernize the codebase, leverage the advantages of a more expressive and safer language, ensure compatibility with the latest Apple platforms, and enhance developer productivity.

Migrating third-party libraries

Along with the codebase, there was a set of third-party libraries (Masonry, Mantle, OHHTPStubs, OCMock, Alamofire, CocoaLumberjack, Firebase, Crashlytics, Instabug) which needed upgrade/replacement with Swift equivalents.

CI

Since the company already used CircleCI, which could support both Objective C and Swift projects, our team replaced some of the scripts, while others were migrated.

programming

Improve application stability

During the code migration process, one of the goals was to identify and address potential issues within the codebase, while enhancing the overall stability of the application by adoption of Swift’s modern and robust language features.

Keep going forward

The primary objective was to ensure a seamless development process, allowing the company to maintain existing functionality, create new features, and deliver value to customers without disruption during the migration period.

 

Challenges

1. Codebase complexity

At that time, the company faced the challenge of dealing with a substantial codebase and numerous third-party Objective C libraries that required rewriting or replacement. Moreover, the complexity of the existing solutions added an extra layer of difficulty in porting them to Swift.

2. Limited time frame

Time constraint posed an additional challenge as the project had a narrow window, requiring meticulous planning and execution to accommodate limited room for unpredictability during the migration process.

3. Partial test coverage

One of the main issues was insufficient test coverage which was crucial during the migration process. To ensure the app’s existing functionality and promptly address potential issues caused by the code migration – it was vital to identify and create missing tests before the migration process.

4. Moving target

As said above, the app was live all the time and the migration work had to be synchronized with the ongoing development and deployment. This one was the most complex part of the whole process.

 

Team Size and Approach

The project team consisted of a client-appointed team lead, complemented by a dedicated group of skilled senior and junior developers provided by BDIT. Despite working remotely, the team maintained continuous communication through various channels such as email, Slack, and other collaboration tools. Daily synchronization ensured effective coordination, while live calls and video conferences were conducted periodically or as needed to address project requirements and facilitate seamless collaboration.

 

Results

Migration was done gradually and on a planned schedule. Code was covered with a mix of unit, integration and UI tests in order to provide stability and eliminate possible new issues. In parallel with migration efforts, regular smoke and/or regression testing were conducted.

 

“Through meticulous planning, gradual migration, and comprehensive testing, the team ensured a smooth transition, and improved application stability.”

 

Testing parties were organized periodically, on milestone releases, to guarantee and further improve the stability of the codebase. It is worth mentioning that we actively participated in the development and deployment of new features alongside with the codebase migration process.

 

GoalsResults
Codebase migration
Migrate from Objective C to Swift
  • Codebase migration was completed successfully by rewriting the view controllers, view models, flow controllers, data and view models, service and helper classes, extensions and other application components in Swift.
  • Successfully completed by rewriting existing unit, integration and ui tests and adding the missing ones.
Migrating third-party libraties
Migrate existing Objective C libraries to Swift: Masonry, OHHTPStubs, Mantle, OCMock, Alamofire, CocoaLumberjack, Firebase, Crashlytics, Instabug
  • Successfully migrated to Swift equivalents where possible: Alamofire, OHHTPStubs, OCMock, CocoaLumberjack, Firebase, Crashlytics, Instabug
  • Replaced with Swift equivalents: SnapKit
DevOps
Adopt CircleCI, Fastlane, Bash scripts for SwiftSuccessfully upgraded for Swift project
Improve application stability
Improve application stability while keep going forwardApplication stability was upheld and improved by resolving existing issues and introducing missing tests during the process

 

Explore our case studies and find out how we help our clients achieve their goals: Case studies.

 

Ready to modernize your app?

Hiring an experienced professional (or a whole team) to migrate your application to a more modern tech stack can reduce costs by minimizing errors, improving efficiency, and avoiding potential rework.