Select Page

What Is Notification.Name and How to Use It

Swift underwent drastic changes with the release of version 3 of the language. As you probably know, those changes weren’t limited to the language and the standard library. Apple made many, many changes to the Foundation framework, for example.

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

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

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.