3 ms·
Yeah, I use them all the time in Swift to model UI state, I find it's a pretty elegant way to avoid invalid states and simplifies UI code a lot.
by jamil7 5y ago
Yeah, I use them all the time in Swift to model UI state, I find it's a pretty elegant way to avoid invalid states and simplifies UI code a lot.
- danpalmer 5y agoYeah they're wonderful for that. Very much like Elm (and/or Haskell). Our whole iOS architecture is inspired by the Elm architecture – it's a pleasure to work with, and Swift the language makes it feel really at home.
- jamil7 5y agoWe're doing something very similar on macOS and iOS. The only rough edge I'm finding with this setup is integrating with Core Data feels a bit clunky/verbose.
- danpalmer 5y agoAh yeah I could imagine this. I haven't used CoreData much, but my understanding is that most of the framework support for it encourages bindings in a traditional MVC sort of approach. I know there is some SwiftUI support but it looks like you have to hand over a lot of control.