SHIFT to Swift

, Pavan Kumar, Swift

SHIFT to Swift

An Unusual Journey from Objective-C

Table of Contents

  • Who should read this document?
  • Objective-C to Learning Swift
  • About Swift
  • Why Swift?
  • Swift vs Objective-C
  • Difference
  • Swift and Objective-C Interoperability
  • Case Study
  • Conclusions

    Who should read this document?

  • The intended audience of this document is any developer

  • We explain all the reasons why to shift from Objective-C and pros, cons over Objective-C. This gives more glimpse of why swift is stronger than Objective-C.

  • This document does not gives programmatic difference/language features rather it highly explains the one over another and winner of them.

  • By reading this document you will get the taste of logical difference between these two languages and which enables you to decide which one is best for your speed development.

Objective-C to Learning Swift

In 2008 Apple announced and released the iPhone SDK 2.0. This event started another revolution in software development, and a new breed of developer was born. They are now recognized as iOS developers.

Many of these developers had never used Objective-C before, and that was the first challenge Apple threw at them. Despite unfamiliar syntax and manual memory management, it was immensely successful, helping populate the App Store with tens of thousands of apps. Apple continually improved Objective-C with each release, adding blocks and literals, simplified memory management with automatic reference counting, and many other features indicative of a modern programming language.

And after 6 years improving and working on Objective-C, Apple decided to throw another challenge at developers. Once again, iOS developers will need to learn a new programming language: Swift. Swift removes the unsafe pointer management and introduces powerful new features, while maintaining interaction with both Objective-C and C.

Swift 4.0 is already a stable and strong development platform, which is sure to evolve in interesting ways over the coming years. It is a perfect moment to start exploring this new language as it is obviously the future of iOS development.

About Swift

Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns. The goal of the Swift project is to create the best available language for uses ranging from systems programming, to mobile and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer. To achieve this goal, we believe that the most obvious way to write Swift code must also be:

Safe. The most obvious way to write code should also behave in a safe manner. Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production. Opting for safety sometimes means Swift will feel strict, but we believe that clarity saves time in the long run.

Fast. Swift is intended as a replacement for C-based languages (C, C++, and Objective-C). As such, Swift must be comparable to those languages in performance for most tasks. Performance must also be predictable and consistent, not just fast in short bursts that require clean-up later. There are lots of languages with novel features — being fast is rare.

Expressive. Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. But Swift is never done. We will monitor language advancements and embrace what works, continually evolving to make Swift even better. Tools are a critical part of the Swift ecosystem. We strive to integrate well within a developer's toolset, to build quickly, to present excellent diagnostics, and to enable interactive development experiences. Tools can make programming so much more powerful, like Swift-based playgrounds do in Xcode, or a web-based REPL can when working with Linux server-side code.

Why Swift?

  • Demand is greater for new Swift to existing Objective-C
  • Swift understands Objective-C better than Objective-C understands Swift.
  • Swift provides features Objective-C doesn't recognize.
  • Swift provides features Objective-C can't.
  • Easier to maintain
  • Is Considered Safer & Faster
  • Is Unified with Memory Management
  • Encourages interactive coding

Swift vs Objective-C


Swift and Objective-C Interoperability

Swift is designed to provide seamless compatibility with Cocoa and Objective-C. You can use Objective-C APIs in Swift, and you can use Swift APIs in Objective-C. This makes Swift an easy, convenient, and powerful tool to integrate into your development workflow. Following important aspects of Swift and Objective-C compatibility that you can use to your advantage when developing Cocoa apps:

Interoperability lets you interface between Swift and Objective-C code, allowing you to use Swift classes in Objective-C and to take advantage of familiar Cocoa classes, patterns, and practices when writing Swift code.

Mix and match allows you to create mixed-language apps containing both Swift and Objective-C files that can communicate with each other.

Migration from existing Objective-C code to Swift is made easy with interoperability and mix and match, making it possible to replace parts of your Objective-C apps with the latest Swift features.

Why do we need Interoperability and Mix and Match?

Even though Objective-C Exists since decades it lacks some features that swift does like

And it’s good phase to start with mix match coding now since Swift reached stable level since it’s debut, and good news that now is it’s Open source so there will be more n more features will be coming out. Small glimpse of mix match as follows

So Swift “Functional” ?

Case Study

So far in our application we are using Objective-C even though we know that language does not have strong type check and more prone in encapsulation, null pointer, etc… , Which influence us to take slow curve on Swift due to

  1. When we need to striclty hide methods in few screens.
  2. To solve null pointer exceptions, Right now it’s really nightmare to detect them.
  3. To use generics for loosely coupled code.
  4. Faster compilation and development process.
  5. With the concept of interoperability we are successfully implemented swift code for mostly used screen.

Note: With success of above cases in our application, now we are completely migrated into Swift with latest version 4.0.


  • SWIFT is another check-point in this story of evolution of functional programming languages.
  • It is the first of the pseudo-functional programming languages which is lining up to become industry standards.
  • SWIFT is definitely a big leap which I think can positively replace Objective-C absolutely. But ….
  • There was one question which triggered this complete research - Why did they shift to SWIFT when Objective-C was serving Apple well?
  • Perhaps Apple was desperate to not miss an opportunity.
  • Perhaps Apple was tired of being too cautious.
  • Perhaps the competition in the market made it a necessity to up the interest in their technologies.


  1. If you have existing project: It’s the time to explore “Swift” in your existing project using “interoperability” and “mix and match” , which makes your code cleaner and future proof with strong language features and it helps in speed development.

  2. If you start new project: I would suggest to go with “Swift” completely if you are starting application from the scratch which enables you strong, safe, fast development.



It is good to have something which is productive but the search for the best should never cease. And when you sniff at something creative, you should go- rather leap for it. Innovate till you live…