Hi Guys, we know Swift has been released on September 9, 2014.
Here is the below table tells the releases happened.
Versions | Date Released | Xcode Version |
1 | September 9, 2014 | 6 |
1.1 | October 22, 2014 | 6.1 |
1.2 | April 8, 2015 | 6.3 |
2 | September 21, 2015 | 7 |
3 | September 13, 2016 | 8 |
The latest version of Swift is 3.0.1 on this day.So, you guys might be thinking why Swift came out to replace Objective-C ?
1. Swift is interactive :
There are Playgrounds which are introduced in Swift. This helps the developer to test a piece of code without compiling the whole project. And the best feature available is we can see the result there itself.
2. Performance of Swift is faster than Objective - C:
Objective-C is slower than the Swift because Objective-C contains C API legacy. In earlier releases of Swift 1.0,1.1 and 1.2, the performance of Swift is slower than the C++ but Swift 2.0 and the higher versions beaten the C++.
3. Possibility of making errors in Swift is less:
The SYNTAX of the Swift is much easier and clean. The best thing about the Swift is Swift handles the absence of values by introducing the optionals. We will learn about them later.
4. Swift is the future:
In future Swift is going to get many updates but in case of Objective-C, it is not going anywhere. But there might be few minor releases might happen or may not be!!!
5. Swift Supports Dynamic Libraries:
Swift is evolving, so there will lot of changes are going to come. So our designed apps should support the latest changes comes out with the newer releases. Dynamic Libraries are the executables that can be linked to an app, which helps the app to update to the latest version of Swift.
This are the 5 major advantages of Swift over Objective-C. Since, there are advantages for Swift doesn't mean that Objective-C chapter has been closed. There are few advantages of objective-c over Swift.
1. Swift Can't Interact with C/C++: If Swift want to talk to C than it has to create a bridge between Swift and Objective-C, where Objective-C can talk to the C/ C++ directly.
2. Swift cannot be compiled as Static Library: Since still the Swift is evolving it can be compiled only as Dynamic Library. But when it comes to Objective-C, it can be compiled into Static as well as Dynamic Library.
These are the most advantage of Objective-C over Swift. Since Swift is evolving, Swift can overcome these disadvantages in the future releases.
Thanks to everyone. Thats it for today.