I recently met with a software development company to commission a new iOS app. I suggested that I wanted it written in Swift as opposed to Objective-C and was told that Swift isn't ready for production.
The app is a list based app, making use of the Map API and making HTTP calls. No complex maths or graphics involved.
What do you say? If not, why not?
I say this as someone who has written many thousands of lines of Swift over the last few months. In an effort to learn the language and explore some user experience ideas I decided to write as much of my app as I could in Swift (it stands at about 95%). Since starting in September of last year I've alternately loved and regretted choosing Swift. For reference, I'll list the pros and cons.
Pros:
- Greater productivity through new "safety" features (lots of caveats here, see the Cons section for why).
- The expressiveness of Swift often means less code to read than with Objective-C. Hopefully that also means less bugs.
- Swift code is (to me) much easier to reason about than equivalent Objective-C.
- The language is just plain nice. This is subjective, and not relevant to your particular case.
Cons:
- The tooling is very immature. I have encountered multiple situations where the compiler itself crashes during a build.
- The static analyzer for Swift code reports erroneous problems. Until you learn the situations it doesn't understand it can lead you down the wrong path to resolution.
- Certain build problems are very difficult to diagnose. I have lost multiple days just searching for code changes that caused the compiler to crash.
- Xcode error reporting for Swift build problems can be vague, ambiguous, or non-existent.
- Xcode crashes, a lot. Technically this is nothing new, but since Xcode 6 I'd argue it has gotten measurably worse.
Swift is clearly going to be great, and it is clearly the future. Unfortunately the future isn't here yet.