Is Migrating from Objective C to Swift Worth the Investment?
Apple is a brand known for innovative products and is often dubbed as the “most innovative company”. Apple is successful because it creates great software to complement its hardware, and is ahead of the curve in terms of software design and user experience.
Apple’s most recent software innovation is a programming language called Swift. In 2019, of the top 110 applications on the App Store, 42% of them used Swift. Out of these if we consider the 79 non-game apps 57% of them use Swift.
Apple further open-sourced Swift in December of 2015, enabling the language to improve even further and get valuable contributions from the Open Source Community.
Benefits of Swift over Objective-C
1. Developing and maintaining your project in Swift is cost-effective
Swift is the future for development in the Apple ecosystem. It is cost-effective to switch to Swift, as the development cost (salary paid to the developers) would be lower, as would the time for development and testing.
The average cost of maintaining a Swift project is 55% cheaper with an average saving of 39$/hour!
2. Language popularity among developers
Currently, the number of Swift repositories outnumber the Objective-C repositories for iOS and macOS.
As you can see, Swift in spite of being less than five years old has already overshadowed Objective-C (the 35-year-old giant). It is because developers love to work on Swift. As per the 2019 Stack Overflow developer survey insights, Swift is the 6th most loved language while Objective-C is the second most dreaded language (just behind VBA).
3. Project maintainability and talent acquisition
While maintaining a large project, time to time people leave the project and it becomes increasingly difficult to replace them. Newer programmers generally prefer Swift. Fast forward 5 years, the knowledgeable Objective-C programmers would be a scarce resource. [source Reddit]
4. Project development time
Objective-C has two separate files that developers are supposed to manage. Swift is more compact and combines Objective-C implementation (.m) file and header (.h) file in one single program code file (.swift).
Lines of code comparison for similar projects written in Objective-C vs Swift:
Migration to Swift
The migration to Swift from Objective-C consists of two phases:
- Syntactic conversion from Objective-C to Swift
- Adopting new features that are introduced in Swift
Swiftify is the best solution available to convert the Objective-C syntax to Swift. It is instantaneous and the conversion results are very reliable. Swiftify automates the redundant task of converting your Objective-C code to Swift so that your developers can focus on other creative and intellectual work.
We have thousands of happy subscribers. Don’t take our word for it — check out our reviews:
At Swiftify, we also provide professional project conversion services where we convert the project for you, adopting the new features introduced in Swift, fixing any possible runtime issues, along with testing and acceptance. Our data suggest that the average speed of source code conversion is 25 KB per hour.
Going by this rate, the time for conversion for some of the famous open-source Objective-C repositories to Swift including testing and would be:
Out of these, we converted SVProgressHUD to Swift, documenting the entire process here. We also added new features to the library and the actual conversion including testing and fixing issues took 30 hours.
According to the response of this developer, whose team converted an Objective-C project with 100,000 LOC to Swift manually, the conversion kept the team engaged for 6 months.
From the above comparision we see that the when using Swiftify there is a saving of 3,000 hours of development time, and $200,000 in terms of development cost.
Did you already migrate your project? Don’t hesitate to share your experience, what tools and approach you used, and how long it took?