Swift has made countless improvements since WWDC 2014. Apple also open-source Swift in 2015. When Apple announced Swift, I was a little excited, even a little surprised. It’s not that I’m not interested in Objective-C, on the contrary, I’m a fan. However, Swift integrates many other language features THAT I like, such as Protocols, closures, Generics, and tuples.
Swift has made countless improvements since WWDC 2014. Apple also open-source Swift in 2015.
When Apple announced Swift, I was a little excited, even a little surprised. It’s not that I’m not interested in Objective-C, on the contrary, I’m a fan. However, Swift integrates many other language features THAT I like, such as Protocols, closures, Generics, and tuples.
I don’t know if you’ve begun to explore the charms of Swift, but this post is a collection of observations and insights FROM my year and a half of using Swift.
1. It’s not just for iOS
Swift, of course, works great on Apple. But now Apple has shipped Ubuntu with pre-compiled binaries, making it available on Linux as well. This is good news for those who want to write Swift on both the server and client side. Some members of the community have gone so far as to apply Swift code to the Android platform.
2. The opportunity to build a language
There aren’t many opportunities to be involved in the process of building a language right from the start. Swift is getting faster, more stable and stronger every day thanks to the community.
When Apple opened source Swift, they created a repository called Swift-Evolution to store user feedback and suggestions for Swift. Swift-evolution is also used to record important changes to SWIFT.
Many features of Swift3.0 are being discussed. Here is a list (link) of what won’t be integrated into Swift3.0, such as integration with C++ and support for concurrency.
It’s very easy to learn
Apple has tried to make Swift easier to learn. Swift Tour is a quick way to get started, and if you’ve written code before, you’ll get up to speed on Swift.
What’s more, whether you’re a beginner or an experienced developer, there are plenty of resources available online. Stanford has free courses on iTunes U, and Ray Wenderlich has plenty of resources on Swift. And if that’s not enough, Coursera, Treehouse, and Udemy all offer many Swift courses.
Also, as I mentioned earlier: Swift is influenced by many other languages. If you’re an experienced developer, you’ll see a lot of familiar syntax and concepts in Swift. Writing code with Swift has never been difficult, at least from my perspective. On the contrary, I find writing code in Swift very natural and easy.
4.Swift is future-oriented
Swift takes a lot of the good features of Objective-C and introduces a lot of new features that solve real-world problems. Swift is a fast, flexible, and powerful language. Objective-c introduces the Automatic Reference Counting (ARC) mechanism, so that programmers don’t have to worry about memory management. Swift retains this mechanism, which means that all the necessary retains and releases have already been set up and you don’t have to worry about garbage collection at all.
Some important features include:
- The ARC mechanism is retained without worrying about garbage collection.
- The Named parameter makes it easier to create and use apis.
- Error handling is simple.
- Swift supports inferred types, which means you can quickly create static types. Swift also has some functional programming templates, such as the Map and filter functions.
- Swift is fast, uses the LLVM compiler to generate machine code and automatically ADAPTS it to the platform, and this Repository records Swift performance.
5. Good tools and a good ecosystem
When you use Swift to write code, most of you are using Xcode as the IDE. Xcode includes interface generators and emulators for different Apple platforms. Don’t like Xcode? You can also use AppCode and even some Text editors such as Sublime Text, Textmate and Vim.
Swift now has three main Package management tools: Cocoapods, Carthage, and the recently released Swift Package Manager. Among them, Swift Package Manager was released simultaneously with Swift open source and has the potential to become a universal Package management solution for Swift.
Also, Swift has a whole integrated ecosystem inherited from Objective-C. For example, Travis usually adds support for new versions of Xcode within a matter of days. This means you can use a number of great testing frameworks, such as Quick, which lets you quickly test Swift code and push it to Github.
So what are you waiting for?
As you might have guessed from the above, I’m a Swift enthusiast. Apple had a great initial design for the language and made it open source to make it better. Here’s what you need to do: Start learning right now.
If you are interested in Swift open source projects, check out swiftChat, a live chat project based on the Dingo SDK. You can get involved and see what can be improved.