Error Handling and Availability
When I first started writing applications with Objective-C, one of the most noticeable deficiencies was the lack of exception handling. Most modern programming languages, such as Java and C#, use try...catch
blocks, or something similar, for exception handling. While Objective-C did have the try...catch
block, it wasn't used within the Cocoa framework itself, and it never really felt like a true part of the language. I have significant experience in C, so I was able to understand how Apple's frameworks received and responded to errors. To be honest, I sometimes preferred this method, even though I had grown accustomed to exception handling with Java and C#. When Swift was first introduced, I was hoping that Apple would put true error handling into the language so that we would have the option of using it; however, it was not in the initial release of Swift. It wasn't until Swift 2 was released that Apple added error handling to Swift...