Swift Development – List of Resources You Must Bookmark
Ever since the introduction of iOS, there is iOS development fever across the globe. Many iOS developers & companies are making fortunate out of it. By using Objective-C and Apple homebrew XCode SDK, there are more than 1 million apps in Appstore now! Apple didn’t stop there, they are going to push it to another level by introducing a new high level programming language – Swift. Objective-C without the baggage of C is how Craig Federighi described it during the conference.
Swift is designed to be fast, modern, safe and interactive. Even though it is a high level programming language, its speed is much more faster than Objective-C. You can mix it with Objective-C and C altogether in a project too (Not a good idea though!).
Honestly, I was pretty excited about Swift. I wanted to dive into iOS development, but as a web developer for half of my life, it isn’t easy for me to get into programming with low-level language. So, this announcement is actually quite an exciting news to me. I started to find resources about it and even started to learn how to use XCode. I decided to start from basic of Objective-C so I’ll know the differences. It was a painful process. Objective-C has been serving Apple well for 20+ years, and I must say, it is not a friendly language at all.
As a PHP developer, I found Objective-C is a beast, very steep learning curve and a lot of weird and repetitive coding. To cut it short, it’s indeed a low-level language, too low to my liking. My motive to learn the basic of Objective-C is to know the native solution first before moving on to high level. Just like how we start by learning Javascript first before moving on to jQuery.
Swift does a lot behind the scene to eliminate all those inconveniences and tedious practives of Objective-C. As a result of that, Objective-C codes are being simplified into shorter code and easier to understand. Take the following code illustrated during the conference as example:
Objective-C
if (myDelegate != nil) { if ([myDelegate respondsToSelector: @selector(scrollViewDidScroll:)]) { [myDelegate scrollViewDidScroll:myScrollView]; } }
Swift
myDelegate?.scrollViewDidScroll?(myScrollView)
Variable assignment is almost the same with Javascript except they eliminate the needs of semicolon. Comparing to Objective-C, it’s just painful to write. Here is the declaration of String type variable.
Objective-C
NSString *myString = @"This is my string.";
Swift
var myString = "This is my string."
Are you getting excited yet? During the my own research and learning, I found a good collection of useful resources about Swift. If you started to learn it just like I do, this list will be very handy. But first of all, you need the SDK. Swift is only available in XCode 6 Beta which only available for those with Apple Developer account, but if you search around *ahem*, you will able to download it elsewhere.
Here you go, below is a list of resources, you will get written tutorials, video tutorials, references, sample codes and swift community. Drop me a commnet if you discovered something useful. Enjoy!
Introduction
- A Swift Tour by Apple. Download from iBook Swift programming language or PDF.
- An Absolute beginners guide to Swift by TeamTreeHouse
- A programmers view of apples new Swift language by Richard Byrne Reilly
- Swift is great but you should still know Objective-C first by Jon Friskics
- Swift – Learn Apple’s New Programming Language by Examples by Udemy
- Developing iOS8 apps using Swift – Create a Todo application by Shiva Narrthine
Tutorial Series #1
A simple and short tutorial created by Fábio Rocha.
Tutorial Series #2
A comprehensive Swift tutorial created by James Quave. This 6 parts tutorials focus on created iOS app. You will learn from basic to advanced techniques such as web API request, Parsing JSON, Table View, Async image loading & caching, interaction with multiple views and best practices.
- Hello World
- Making a web API request and parsing the JSON
- Some best practices using Protocols and Delegates
- Adding an interactive Table View
- Async image loading and caching
- Developing iOS 8 Apps Using Swift Part 6 – Interaction with multiple views
Tutorial Series #3
This tutorial will walk you through the creation of a geolocation based alarm app for travelers. The concept is simple: users create a new alarm by selecting both a geographic region and music item from their library. When the phone detects itself crossing the region boundary of an alarm (enter or exit) the relevant music plays.
Tutorial Series #4
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。