Refactoring

One of the core elements of clean code is having code that is consistent with identifiers. Head to the AppDelegate. Take a look at this code from the tip from last week. I have a few problems with it. I'm not being very consistent in some of those identifiers such as the HueColorTVC and ColorTableViewController. …

Understand ARC

One of those difficult things for even experienced developers to understand is Automatic Reference Counting, or ARC. It is how Swift manages and conserves memory automatically.  Take a look at the Exercise file. I have a playground in this project with two classes. One is a pizza topping. One is a Pizza. Look at the …

Understand Closures

You'll find closures throughout the API's, but you may not know how to use them properly. Let's take a basic tour of closures.  Download the exercise file, and you'll find a project with a playground. In the playground you'll find a function  to compute a pizza volume. That's for a round pan pizza, for a …

Actions in Table Views

Sometimes table views could use a few buttons. There's two delegates which create swipe buttons on table view cells. Let's learn how you can implement these buttons and an interesting hidden feature you can do with them.  There is two delegate methods, one for the leading swipe configuration and one for the trailing Swipe configuration. …

Thrown Errors

There's many ways to handle errors in Swift. For some errors, using throws is a great way to handle errors without crashing the system. Download the exercise file. You'll find a project with an embedded playground.  While there's a lot better ways to do this, I'll use an example of a function coffee(name:) that finds …