iOS For Beginner

Swift 2.0

Swift 2.0 also includes a lot of new language features and refinements. Expect to see blog posts exploring the features in more depth, and be sure to watch for the WWDC sessions covering these topics all this week.

A few of the new features include:

Error handling model: The new error handling model in Swift 2.0 will instantly feel natural, with familiar try,throw, and catch keywords. Best of all, it was designed to work perfectly with the Apple SDKs and NSError. In fact, NSError conforms to a Swift’s ErrorType. You’ll definitely want to watch the WWDC session on What’s New in Swift to hear more about it.

Availability: Using the latest SDKs ensures you get access to new features and information about platform changes. But sometimes you still need to target an older OS, and Swift makes doing so much easier and safer. The Swift compiler now shows an error when you use an API that is too new for your target OS, and #available blocks can safely wrap lines of code to only run when on the right OS versions.

Protocol extensions: Swift is very focused on protocol ­oriented development — there’s even a session on the topic at WWDC 2015. Swift 2.0 adds protocol extensions, and the standard library itself uses them extensively. Where you used to use global functions, Swift 2.0 now adds methods to common types so functions chain naturally, and your code is much more readable.

Swift­er SDKs: Swift 2.0 works even better with the Apple SDKs, thanks in part to two new features in Objective ­C: nullability annotations and generics. The SDKs have been updated to annotate API that cannot return nil so you don’t need to use optionals as often. And with a true generics system employed by the SDKs you can more often preserve detailed type information in your Swift 2 code.

Get more information about swift 2.0 Here.

You don’t need to download separate SDK for swift. When you download xcode 7.2 as we mentioned in this tutorial. You can just give the language name instead of objective ­c to swift.

Steps to change the language from objective c to swift :

When you open xcode and create new project.You will see the window like enter the project name , organization name, You will get the option like select language.In that select swift instead of objective c. Like this :

Change Language

Change Language that’s it, Then you can start code with swift. So these are the main basic and some advance concepts are explained in this chapter.

Please login to get access to the quiz
Swift Language (Prev Lesson)
(Next Lesson) iOS Development Basics
Back to iOS For Beginner
Inquire Now
close slider