Select Page
Unboxing JSON With Swift and Unbox

Unboxing JSON With Swift and Unbox

Many developers new to Swift seem to be struggling with JSON. Despite the speed of Foundation’s JSONSerialization class, it hands you an object of type Any, leaving it up to you to unwrap the object you received.

Four Clever Uses of Swift Extensions

Four Clever Uses of Swift Extensions

If you’re reading this, then I assume you’re familiar with Swift extensions. A Swift extension allows you to add functionality to a type, that is, a class, a structure, an enumeration, or a protocol. But extensions are more powerful than that. In this tutorial, I’d like to show you four clever uses of Swift extensions.

What Is the Difference Between Strong, Weak, and Unowned References

What Is the Difference Between Strong, Weak, and Unowned References

In yesterday’s installment of Understanding Swift Memory Management, you learned how weak and unowned references can be used to break a strong reference cycle. It’s time to take a closer look at what sets weak and unowned references apart from strong references. We also revisit weak and unowned references. What is the difference between weak and unowned references? When is it appropriate to choose an unowned reference over a weak reference?

What Are Strong Reference Cycles

What Are Strong Reference Cycles

In the previous installment of this series, you learned about Automatic Reference Counting and how it helps keep memory management in check. Remember that a class instance is deallocated if no properties, constants, or variables hold a strong reference to the class instance. I didn’t explain what a strong reference is, though.