Episodes
πŸ”’ We've studied `Equatable` and `Hashable`, their laws, and saw how value types as simple bags of data easily conform via "structural" equality. What about reference types? Reference types are an amalgamation of data _and_ behavior, and that data can be mutated in place at any time, so how can they reasonably conform to these protocols?
Published 10/21/24
Published 10/21/24
πŸ”’ While the documentation for `Equatable` discusses the notions of "equivalence relation" _and_ "substitutability", there are conformances in the Standard Library that run afoul, but for pragmatic reasons. Let’s explore them and then dive deeper into a related protocol: `Hashable`.
Published 10/14/24
πŸ”’ In this series we go back to basics with a deep dive into the subject of `Equatable` types. Equatability is a deceptively simple topic. It is a surprisingly tricky protocol that has some very specific semantics that must be upheld baked into it, and there are many misconceptions on how one can or should conform types to this protocol.
Published 10/07/24
πŸ”’ We round out our series with one more feature: the ability for our users to manage a list of their favorite facts. It will allow us to explore a complex side effect, persistence, and show how the same Swift code can save and load data across iOS app launches _and_ web page refreshes.
Published 09/23/24
πŸ”’ We've already covered a lot of ground and could have ended the series last week, but let's do a few more things to show just how powerful cross-platform domain modeling can be by adding a _new_ feature to our cross-platform application and see just how easy it is to integrate with SwiftUI, UIKit, _and_ WebAssembly.
Published 09/16/24
πŸ”’ We will introduce UI controls and focus logic to our SwiftWasm application by leveraging a binding type inspired by SwiftUI, and we will see how similar even our view logic can look across many platforms.
Published 09/09/24
πŸ”’ We will introduce navigation APIs to our Wasm application, starting simply with an alert before ramping things up with a `dialog` tag that can be fully configurable from a value type that represents its state and actions.
Published 09/02/24
πŸ”’ Let's dial up the complexity of our Wasm application! We'll introduce some async logic in the form of a network request. We'll take steps to not only control this dependency, but we'll do so across both Apple and Wasm platforms, and we'll isolate its interface from its live implementation to speed up our builds and reduce our app's size.
Published 08/26/24
πŸ†“ We are going to take a Swift feature _into the browser_. We will set up a WebAssembly application from scratch, show how to run and debug it, and even set up some basic UI. And then we will integrate our existing model into it, all powered by the magic of Swift's Observation framework.
Published 08/19/24
πŸ†“ It's time to go cross-platform! We will take a feature written in Swift and use it in vastly different situations, including not only SwiftUI and UIKit, but beyond Apple's frameworks and ecosystems. We will start with a baby step and introduce our feature to a third party view paradigm, Airbnb's Epoxy.
Published 08/12/24
πŸ”’ While we rebuilt SwiftUI bindings in UIKit to power state-driven navigation, that's not all SwiftUI uses them for! Let's see what it takes to power `UIControl`s from model bindings. And finally, let's ask "what’s the point?” by comparing the tools we’ve built over many episodes with the alternative.
Published 07/29/24
πŸ”’ We round out our stack navigation tools with support for an `@Environment`-like feature for holding onto the stack's path, a `NavigationLink`-like feature for pushing features onto the stack from anywhere, and we'll handle every corner case from deep-linking to user dismissal.
Published 07/22/24
πŸ”’ We have now implemented tree-based navigation in UIKit, driven by the Observation framework, but there is another form of navigation to think about: stack-based navigation, where you drive your navigation from a flat collection of states rather than a heavily-nested type. Let's leverage Observation to build a really nice tool for stack-based navigation.
Published 07/15/24
πŸ”’ While SwiftUI bindings were almost the perfect tool for UIKit navigation, they unfortunately hide some crucial information that we need to build out our tools. But never fear, we can rebuild them from scratch! Let's build `@Binding` and `@Bindable` from scratch to see how they work, and we will use them to drive concise, tree-based navigation using enums.
Published 07/08/24
πŸ”’ We have built the foundation of powerful new UIKit navigation tools, but they're not quite finished. Let's improve these APIs to handle dismissal by leveraging another SwiftUI tool: bindings. We will see how SwiftUI bindings are (almost) the perfect tool for UIKit navigation, and we will see where they fall short.
Published 07/01/24
πŸ”’ Now that we have a tool that brings the power of the Observation framework to UIKit, let's put it through the paces. We will use it to build state-driven navigation tools that can drive alerts, sheets, popovers, drill-downs, and more, and they will look a lot like SwiftUI's navigation tools.
Published 06/24/24
πŸ”’ It's time to build modern tools for UIKit from scratch, heavily inspired by SwiftUI and using the Observation framework. Surprisingly, Swift 5.9's observation tools _can_ be used in UIKit, and in fact they work _great_, despite being specifically tuned for SwiftUI.
Published 06/17/24
πŸ†“ We finish building a modern UIKit application with brand new state-driven tools, including a complex collection view that can navigate to two child features. And we will see that, thanks to our back-port of Swift's observation tools, we will be able to deploy our app all the way back to iOS 13.
Published 06/03/24
πŸ†“ As we approach WWDC24 and 5 years of SwiftUI, let's talk about… UIKit! 😜 We love SwiftUI, but there will still be times you must drop down to UIKit, and so we want to show what modern UIKit development can look like if you put in a little bit of effort to build tools that allow you to model your domains as concisely as possible.
Published 05/27/24
πŸ†“ We conclude the series by stretching our use of the `@Shared` property wrapper in isowords to two more features: saved games and user defaults. In the process we'll eliminate hundreds of lines of boilerplate and some truly gnarly code.
Published 05/20/24
πŸ†“ Let's apply the Composable Architecture's new state sharing tools to something even more real world: our open source word game, isowords. It currently models its user settings as a cumbersome dependency that requires a lot of code to keep features in sync when settings change. We should be able to greatly simplify things with the `@Shared` property wrapper.
Published 05/13/24
πŸ†“ We finish refactoring the SyncUps application to use the Composable Architecture's all new state sharing tools. We will see that we can delete hundreds of lines of boilerplate of coordination between parent and child features, _and_ we won't have to sacrifice any testability, including the _exhaustive_ testability provided by the library.
Published 05/06/24
πŸ†“ In our last series we developed a wonderful way to share state between features in the Composable Architecture, and even persist it, all without sacrificing testability, but we also didn't get to show the (just now released) tools being used in real world applications, so let's do just that, starting with SyncUps.
Published 04/29/24
πŸ”’ It's incredible how easy `@Shared` makes it to persist complex data types to the file system, but currently it completely ruins our ability to test features that use it. Let's fix that, and we will also explore what it means to derive a small piece of shared state from a bigger piece of shared state.
Published 04/22/24