Please note, this blog entry is from a previous course. You might want to check out the current one.
To run the Smashtag code with Swift 1.2. are quite extensive:
- countElements() is now called count()
- as needs to be replaced with as!
- reduce() requires the combine parameter named explicitly
- same with custom methods, its now quite strict …
- let is now more restrictive, some parameters have to be changed to var (it might be I went a little bit over board here)
- NSString is no String any more and needs to be cast explicitly
- if a parameter is set within a closure of the init method, set a default value outside
The updated code is available on GitHub.
For those interested in an updated version that works with Swift 2.0 I just posted an updated version that is working for me so far: https://stackoverflow.com/a/34746213/2148892