Answer the question
In order to leave comments, you need to log in
What is the qualitative difference between the Swift programming language and other languages?
Hello.
I want to appeal to people who have experience in developing in Swift.
My question is, Apple writes:
"Swift's unique combination of elegance, power, and safety has the opportunity to move the entire software industry forward."
Is this just marketing, or is there something unique about Swift that other languages don't have, or something that makes it better than other languages?
Answer the question
In order to leave comments, you need to log in
The functionality of enums, structures has been expanded - in many respects they are now similar to classes.
enum Barcode {
case UPCA(Int, Int, Int, Int)
case QRCode(String)
}
Closures (lambda, blocks), sorting can be written
reversed = sorted(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } )
reversed = sorted(names, { s1, s2 in return s1 > s2 } )
reversed = sorted(names, { s1, s2 in s1 > s2 } )
reversed = sorted(names, { $0 > $1 } )
reversed = sorted(names, >)
Error handler
enum CarEngineErrors: ErrorType {
case NoFuel
case OilLeak
case LowBattery
}
func checkEngine() throws {
guard fuelReserve > 0.0 else {
throw CarEngineErrors.NoFuel
}
...
}
Swift in open source
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question