Introduction
These days in the Apple universe often is asked whether to start in the new language Swift or Objective-C.
Background
I am programming in Objective-C but now diving into Swift and have some experienve and see some pros and cons.
Where is the ";"?
The answer is as expected: 42. These languages arent so different. They are both translated with the LLVM, but Swift has more and better optimization. Also is "bridging" between these languages possible. Swift is in many way a "compressed" version of Objective-C.
For a starter I would recommand Objective-C because it is the common language and a lot of code is available.
Swift is more modern and very compact, so it need REALLY no semicolon and in few lines of code much stuff is done. For instance it has no header file and declarations also are defining the type and that the value is constant.
let text = "I am a fixed text"
var number = 10.0
var state = eStateNormal
Remark: It is also possible to explicitly define the type, but because the needed initialization it is not needed.
var text:String = "I am a normal text"
Tricky gets Swift at optionals. This are "boxed" types which may or may not hold a value. Because they throw exceptions coders should take care in handling them.
var object?
object = "Hello world"
if let text = object! {
println("Value is \(value)")
}
Points of Interest
It is my short hand point of view and dont want to make it a battleground.
For detailed information is the first point the Apple Developer Site. I like the WWDC videos to get started.
Also I recommand to take a look at the website of the famous Ray Wenderlich. For a starter like you is the Video plan an interesting investion.
I would start with Swift only on a new "blank sheet" project, because I dont like switching the languages in one project.
History
First shot.