Use Dynamic Type

For reading ease and visual accessibility you should be using dynamic fonts whenever possible. Let's look at an example you can get from the download files. I've run the Split View Controller from a previous tip in landscape on an iPad Pro 9.7 inch. Take a look at the labels on the table. They are …

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 …

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 …

Ranges in Swift

You’ve probably used ranges in loops, without knowing it, but ranges are really a type in Swift. Have you ever thought about ranges and all their power? I’ll show you a few things you might want to know about Swift ranges. I've put a playground into a Project for an exercise file. I added there an …

Sliders as Knobs

You've seen other apps rotate views, but you may have no idea how to do it yourself. Let me show you one way to rotate views. We'll make a simple knob control you might be able to use in your apps. Download the example file. On the storyboard, I added an UIImageView of a knob …