Should I migrate my app to Swift 3


 Image result for Swift language


 Hello Friends,  Today we are going to discuss about Swift language.

What is Swift?

Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of extant Objective-C (ObjC) code written for Apple products.

Swift was introduced at Apple's 2014 Worldwide Developers Conference (WWDC), but still it is growing & improving by programmers & we are getting different version from time to time since launched. But we are still in doubt to adopt it for our app.
 Image result for Swift language

According to me, Swift is the future. So, we should walk with the latest tools & technologies to build high quality apps to maximize user experience.

I am sure Apple will remove support for objective-C in future, because it is highly challenging to make built-in APIs for both languages.

So, If you plan to make new app then use latest swift version with latest Xcode only. Swift2 support is also removed from Xcode 8.3, this indicates for migrate your older Swift apps to newer Swift version for better support.
 

Cons of Swift:

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.

Additional Features of Swift:

  • Closures unified with function pointers
  • Tuples and multiple return values
  • Generics
  • Fast and concise iteration over a range or collection
  • Structs that support methods, extensions, and protocols
  • Functional programming patterns, e.g., map and filter
  • Powerful error handling built-in
  • Advanced control flow with do, guard, defer, and repeat keywords

What should I do for legacy Objective-C app?

  •  Analyze the efforts need for migration
  •  Analyze the future expansion of app
  •  Build a plan for migration
  •  Use Bridging Header for new file & Add swift code only

 

Conclusion:

Swift includes features that make code easier to read and write, while giving the developer the control needed in a true systems programming language. Swift supports inferred types to make code cleaner and less prone to mistakes, and modules eliminate headers and provide namespaces. Memory is managed automatically, and you don’t even need to type semi-colons.

" I strongly recommand you all to use Swift only"


Thank you,

Appsbit

https://appsbit8.wixsite.com/appsbit

 



 







Comments

Post a Comment