Mobile App Development (Objective C --> Swift)

A general overview of the similarities and differences of Objective C + Swift development, the start of a conversation with the existing Open edX Mobile development team members on assessing the new Swift based code base.

 

TL;DR: While not as default choice as Kotlin is for Android, Swift powers the majority of the top 1000 applications and speeds up development timelines and increases developer satisfaction to work with. Use it ASAP.


Key Coverage Areas:

1 - Benefits of Objective C → Swift Switch

2 - Drawbacks of Objective C → Swift Switch

3 - Swift Resources

Benefits of Objective C → Swift Switch

Switching to Swift from Objective-C for mobile app development offers several benefits:

  • Improved safety: Swift is a type-safe language, which means it can help prevent common programming errors that can lead to crashes or other issues. It also includes features like optionals and automatic memory management that can help make code more reliable and less prone to errors.

  • Increased speed and performance: Swift is generally faster than Objective-C, which can help improve overall application performance.

  • Easier to learn: Swift has a more modern and streamlined syntax than Objective-C, which can make it easier for developers to learn and use. It also includes features like type inference and closures that can reduce the amount of code required to perform common tasks. According to the 2022 Stack Overflow Developer Survey, 63% of iOS Developers love using Swift, while over 76% dread Objective-C.

  • Improved interoperability with other languages: Swift can be used with other programming languages like Objective-C and C, which can make it easier to integrate with existing codebases or libraries.

  • Active development: Swift is actively developed and maintained by Apple, which means it is likely to continue to improve and evolve over time.

Drawbacks of Objective C → Swift Switch

There are also some potential drawbacks to using Swift:

  • Less mature ecosystem: Swift is a relatively new language compared to Objective-C, and while this is cited also as a drawback of the Java / Kotlin progression, Apple’s support for Swift and the ecosystem’s shift to this language likely mitigates this issue. (Over 63% of top 1000 iOS apps were Swift apps in 2021 )

  • Backwards compatibility: Swift is not fully backwards compatible with Objective-C, which means developers may need to rewrite some existing code to use it. It isn’t clear to me how this impacts applications with both Objective-C + Swift code, and what implications this has on architectural patterns.

  • Changing language: As a relatively new language, Swift may continue to evolve and change over time, which could require developers to update their code to keep up with changes.

Swift Resources + Reading