The Dominance of Swift over Objective-C in iOS Development: A 2019 Analysis
As a seasoned iOS developer, I can confidently say that the adoption of Swift over Objective-C has been a notable trend in the iOS development community. This shift is driven by both the strategic and practical decisions made by developers, teams, and companies.
Strategic Shift from Objective-C to Swift
The reasons for this migration are multifaceted. Firstly, Apple's clear direction towards Swift indicates that it is the future of iOS development. Apple has stated that future APIs and development will be in Swift, which means that Objective-C, while still supported, will eventually be deprecated. This aligns with the company's vision to move away from Objective-C, signaling a long-term decline in its relevance.
Many developers and teams have already begun converting their codebases from Objective-C to Swift. In fact, a significant proportion of the iOS developers I know, whether in Swift-only projects or actively working on removing Objective-C, are moving in this direction. This is largely due to the promise of future APIs and functionalities being exclusively available in Swift. For new projects, the reasons for choosing Swift are compelling, including better type safety, higher performance, and a more modern syntax.
Current Market Trends
According to Google Trends, the usage of Swift has significantly outperformed Objective-C. In 2019, the proportion was roughly 6:1. This trend may be influenced by various factors, such as:
Experienced Objective-C programmers may not require external help since they are proficient in Objective-C and can work independently. In long-term projects, developers might continue using Objective-C due to their reusable components, which make search for external help unnecessary. The majority of development time is spent on new classes, adding properties to existing classes, and calling web services, which typically do not require external help.Of course, there are still projects that use Objective-C, especially for legacy code. Some companies and app owners may find it cost-prohibitive to fully migrate to Swift, leading them to continue using Objective-C despite the growing trend towards Swift.
Real-World Examples
Apple's assertion that over 60-70% of the apps on the App Store were developed using Swift in 2019 further illustrates the shift towards Swift. While some developers continue to use Objective-C, the majority are migrating for several reasons:
New development: For new projects, Swift is the preferred choice among most development teams. Legacy code: For existing projects with a significant amount of Objective-C code, full migration might not be feasible due to time and cost constraints. Long-term viability: Apps like Snapchat, Instagram, and Twitter, which were built in the early days of the App Store and have vast amounts of Objective-C code, would not be feasible to fully convert to Swift.Companies are increasingly opting for Swift due to its modern features, productivity benefits, and compatibility with Apple's latest tools and frameworks. As a result, the trend towards Swift is likely to continue, making Objective-C a legacy language in the iOS development ecosystem.
In conclusion, while Objective-C might still have a place in certain legacy projects, the overwhelming majority of iOS developers are migrating to Swift due to its future-proof nature and the support from Apple.