Swift Language

Swift Language

It actually swift unlike https://www.swift.com/

A bit of history

First introduced at Apple’s 2014 Worldwide Developers Conference (WWDC), the Swift programming language has generated considerable debate ever since. Chris Lattner, Apple’s Senior Director, of the Developer Tools Department, started designing the basic concepts of the new language back in 2010.

Prior to Swift

Prior to Swift coming into the picture, Objective-C was used to develop mac and ios apps.

Objective-C is the primary programming language you use when writing software for OS X and iOS. It’s a superset of the C programming language and provides object-oriented capabilities and dynamic runtime. Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods. It also adds language-level support for object graph management and objects literals while providing dynamic typing and binding, deferring many responsibilities until runtime.

More about Objective-C here: developer.apple.com/library/archive/documen..

Swift

Swift is a powerful and intuitive programming language for iOS, iPadOS, macOS, tvOS, and watchOS. Writing Swift's code is interactive and fun, the syntax is concise yet expressive, and Swift includes modern features developers love. Swift code is safe by design and produces software that runs lightning-fast.

Since every operating system, Apple has released after OSX 10.9 and iOS7 is compatible with Swift, it’s a great language to learn if you’re interested in iOS and macOS development.

With some of the best aspects of Objective C, Swift is also a convenient language for developers working outside iOS and macOS development, like Game Developers who rely on it to produce fast and readable code.

Also, as of September 2020, there’s official support available for the full Swift ecosystem on the Windows platform, opening up an even wider range of developers who may want to tap into this powerful, general-purpose language.

Learn more here - developer.apple.com/swift

Why learn Swift

  • Swift provides better management of memory

  • Compatibility with Apple devices

  • Swift offers convenient error-handling features

Pros and Cons

Pros:

  • Rapid development process.

  • Easier to scale the product and the team.

  • Improved safety and performance.

  • Interoperability with Objective-C.

  • Full stack potential and cross-device support.

  • Vibrant open source community.

Cons:

  • Swift is considered a “moving target”.

  • Limited talent pool.

  • Lack of support for earlier iOS versions(Prior to ios7).

What should I learn Objective-C or Swift?

This is common when you’re working for a company that has been around for 5+ years(Assuming people started using it in production apps in 2017) - remember Swift was only released in 2014. It’s common that you’ll have to work in a hybrid codebase consisting of old code in Objective-C and new code in Swift.

Another reason you could need to know Objective-C is if you’re working on older open-source projects written in Objective-C. If you’d like to contribute, you’ll have to learn the language the code base is in.

Typically though, Objective-C should only be learned if required. Most new iOS apps would be fine just completely coded in Swift.

Also, check this debate on Reddit: reddit.com/r/iOSProgramming/comments/tv3gsc..

References

blog.prototypr.io/the-good-and-the-bad-of-s..