Good reasons to use Swift might include the following:
- You think you can make good use of the features Swift offers (generics, sum types, optionals, namespaces, typed containers) and are willing to not just write Objective-C code with a different syntax.
- You are willing to take a short-term productivity hit to learn a language which will probably become the crux of Apple's developer tools in the future.
- Your project isn't going to rely heavily on the dynamic features Objective-C offers (e.g. method swizzling, adding or replacing classes and methods at runtime).
Things that are troublesome with Swift include the following:
- Swift's interoperability with Objective-C and Cocoa Touch is still touch-and-go in a lot of places. It's been getting better, but unless you understand how both Cocoa Touch and Swift work, you will just have to take on faith things like IBOutlets being implicitly unwrapped optionals.
- Xcode's stability when it comes to working with Swift projects leaves much to be desired. The level of instability also seems to vary; I've worked on files that crashed SourceKit over and over and files that caused the IDE no trouble at all.
- I wouldn't call Swift alpha-quality, but there are still compiler and runtime bugs that need to be addressed.
(BTW I really wish HN supported proper lists in comments. Doing the two-space indent just makes everything run off the screen.)
The thing that bothered me most was that iOS app wrote with Swift was packaged with 8 MB runtime libraries, so it was like 100 kB of my code and 8 MB of swift runtime libraries which I didn't like at all.
I tried to learn how to write an OS X application with Swift and for some reason it became a nightmare, SourceKit keeps crashing and it wasn't possible to work at all. I guess I triggered some bug. I tried to investigate it, but without much success, I think that XCode will send those crash logs to Apple and may be things are already fixed.
Actually I'm not really sure that Swift is the language I want to use. Objective C is good enough. It's good old C which I like. It's very dynamic which I like. Cocoa, Cocoa Touch and other frameworks are made for Objective C, not for Swift. I didn't made a final decision whether I will invest into Swift, but probably (at least until Apple declares Objective C obsolete) I will just use Objective C. It has its problems, but it has its strength too.
Whether or not it's the write time to use it in production is another separate issues that will depend on the app. For fairly simple applications it seems like it's fine to use it now. There is talk that Apple have banned use of swift within the company. That's obviously false, otherwise they wouldn't be able to further develop the language. I do fully expect that to use swift in a production project you would need high level authorisation and probably close coordination with the swift dev team. That would just make sense.
He thought it was good idea when I suggested learning Obj-C and then using Swift to cut down on dev time, b/c it is quicker for many things.
I don't think any of Swift's current problems are unfixable but I'd give it another year or so at least to mature.
And I'm not sure about this, but the documentation is also off in a lot of places. Essentially anywhere there is a 'setX' is meaningless because that function won't actually exist even if the (Swift) page for it claims it does because in most case you just access the variable.
In theory it's nice to work with, as it forces you to think everything more carefully and consider all error/nullable cases. In practice, integration with XCode is still full of bugs, code completion is crashing all the time, Swift classes show up as missing symbols in Objective-C (but the project compiles fine)... So, it's a bit painful and it slows down the development process.
We will keep it to very small and well-defined pieces of code for now. It's good to learn about it, but it's not productive.
The annoyances are not with the language, but with the tooling. Slow auto-complete and lack of incremental compilation are my wishes for Apple to fix soon.
I took his course a few years ago when I got started programming, it was great.