Ever since the introduction of iOS, there is iOS development fever across the globe. Many IOS developers & companies is making fortunate out of it. By using objective-c and Apple homebrew XCode SDK, there is more than 1 million apps in AppStore now! Apple didn ' t stop there, they is going to push it to another level by introducing a new high level programming language– Swift. Objective-c without the baggage of C is what Craig Federighi described it during the conference.
Swift is designed to be fast, modern, safe and interactive. Even though it is a-a high-level programming-language, its speed was 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 in IOS development, but as a web developer for half of my life, it's ' t easy for me to get into progra Mming with low-level language. So, this announcement is actually quite a exciting news to me. I started to the 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 have been serving Apple well for 20+ years, and I must say, it's 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 are to know the native solution first before moving on to high level. Just like how we start by learning Javascript first before moving in 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 is 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."
Is you getting excited yet? During the My own and learning, I found a good collection of useful resources about Swift. If you started to learn it just like I did, this list would be very handy. But first of all, you need the SDK. Swift is a available in XCode 6 Beta which only available for those with Apple Developer account, and if you search ARO und *ahem*, you'll able to download it elsewhere.
Here you go, below are a list of resources, you'll get written tutorials, video tutorials, references, sample codes and S Wift 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 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.
- Swift Tutorial for Beginners Part 1
- Swift Tutorial for Beginners Part 2
Tutorial Series #2
A comprehensive Swift Tutorial created by James Quave. This 6 parts tutorials focus on created IOS app. You'll learn from basic to advanced techniques such as Web API request, parsing JSON, Table View, Async image loading &A mp 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 would 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 a alarm (enter or exit) the relevant music plays.
- Let's make a Swift app
- Lets make a Swift app part 1
Tutorial Series #4
We Heart Swift is a new website dedicated for Swift programming. They is going to be covering cool stuff they found.
- How do a simple table view with IOS8 and Swift
- Swift Classes–part 1
- Swift Classes–part 2
- Swift around–simple TableView with a custom cell type
- Make awesome UI iOS8 using Swift XCode 6
Video Tutorials
Sample Code
Sometimes, the quickest-on-the-pick up a language are to learn by sample. Here we have a list of Swift applications so you can download and study it.
- Flappyswift–code
- swiftexample–table views and Web views demostrations
- Swift Rss–an RSS reader app written in Swift. About lines of code and written within on an hour. Proved Swift is a good programming language
- Minimalistic Swift HTTP request agent for IOS and OS X
- Hackernews Reader IOS App
- Swift–game of Life–conway ' s Game of life written in Swift with SpriteKit
- Swiftnote–simple note taking app with today widget and ICloud syncing.
- Uiimageview–betterface swift–a Uiimageview extension to let the picture-cutting with faces showing better
- Uicatalog:creating and customizing UIKit Controls in Swift–ios Developer Library
- Adventure:building a SpriteKit Game Using swift–ios Developer Library
- gesturerecognizers:using Standard Uigesturerecognizers–ios Developer Library
- Lister:a Productivity App Built in Swift–ios Developer Library
Quick References
- Swift Cheat Sheet and Quick Reference
- Swift Cheat Sheet by KPKP
- String Reference Guide for Swift
- Array Reference Guide for Swift
- Swift Cheat Sheet by Grant
- Swift Cheat Sheet
Swift Community
- Google + Swift Community
- Github Swift Trending repositories
- StackOverflow Swift Language
- Reddit IOS Swift
- V2ex–in Mandarin Language
- Swiftchina–in Mandarin Language
- Swift china–in Mandarin Language
Swift Development–list of Resources you must Bookmark