Coming in a bit late due to some travels to New York and then to India over the last couple of days but here we are:
- Basic Unit Testing and the use of the XCTest library to assert critical methods from simple projects we had previously built within the University of Washington iOS Certificate. To deepen my understanding of Unit Testing, I have also started the Ray Wenderlich dedicated tutorial which goes further with the use of stubs, mock objects, UI testing and performance testing. A new programming skill from which I just started to scratch the surface!
- Better/easier Serialization is coming for Swift, and will provide a way to encode struct and enums and a type safe solution to serialize to external formats like JSON and plist. No more
if let dict = json["myDict"], let val = dict["myVal"]or -worst- nested conditional unwrapping. It will also removed the need for dedicated framework such as SwiftyJSON.
- Using inout parameters to manipulate external variables (external from the scope of the function). The variables are passed by reference, and therefore sustained any modification applied by the function. See Apple’s documentation for full details.
- Using protocols to handle networking calls and subsequent results (with dependency injection) not only make the code more readable but also allows for better testing. Great article from Natacha The Robot!
- Method dispatch, 3 primary methods (direct, table, and message) and all of them are supported by Swift. If you ever wondered what’s really behind the
@inlinekeywords and about overall code performance, I found this article from Raizlabs extremely well written. It details how Swift handles dispatching for value types, classes, protocols and NSObjects while also highlighting what matters in how we write code (use of extensions or of reference value for instance).