Should outlets be declared weak or strong? It’s a question that pops up surprisingly frequently. In this tutorial, I’d like to definitively answer this question. I also explain the why of the answer.
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.
Even though forms aren’t difficult to implement on iOS, they can be frustrating to use. In today’s tutorial, I’d like to share five simple tips that can drastically improve the usability of the forms in your iOS applications.
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.
If you’ve been paying attention, then you may have noticed that we haven’t resolved the strong reference cycle of the Device class. Remember from earlier in this series, this is what the Device class looks like.
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?
Strong reference cycles can cripple your application. In this article, I show you how to resolve the strong reference cycles we created in the previous installment of this series.
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.
Before we can discuss Automatic Reference Counting, ARC for short, you need to understand the difference between value types and reference types.
Earlier this week, I showed you how to create a custom control using a bitmask. But it’s time to take it one step further by adding RxSwift to the mix. In this tutorial, we make the custom control we built reactive using RxSwift.