ianterrellwt
We've also found reproducing the UI via state to be a huge win. We're using FBSnapshotTestCase to generate snapshots of our app across different controllers with different states, automated to take snapshots on different devices and in different orientations.
Glad to see other people are pursuing these ideas!
The benefits I've seen so far:
- Swift's type safety means you can validate at the type level that your app state is correct. As in, you could have an enum with separate cases for your authenticated and unauthenticated states, instead of optional values to indicate what state you're in. This makes your state stronger, in that the types hold only valid states rather than some possible states being invalid (e.g. unauthenticated with non-nil user info).
- State transitions -- reducer methods, (state,action) -> state -- are purely functional which makes (IMHO) feature work straightforward, testing trivial, and debugging fairly easy.
- Your view controllers become super dumb. All they have to do is render the data and relay input events. This is a nice clean separation of concerns.
- If your navigation route is managed in state, you get deep linking "for free". This is especially helpful in one of our apps for handling global errors that could occur on any network request (update state, route to error).
- Every bit of code has an easily identifiable home.
- Communicating between view controllers is simple. Rather than "passing the baton" as state is accumulated (say a multistep form), state accumulates naturally in the store.
I'm working on combining ReSwift with app coordinators here: https://github.com/willowtreeapps/cordux
I've written about it a little bit here: http://willowtreeapps.com/blog/app-coordinators-and-redux-on...
All that said, I still consider this an experiment. We've written about 40-50k lines of Swift across two apps with 8 developers so far, and opinions are mixed between considering it excellent and considering it burdensome.
Roles: iOS Engineer, Android Engineer, Web Developer, General Engineer
We're an apps agency that works with brand name clients. We're ranked one of the best places to work by GlassDoor [0] and Fortune [1]. I can confirm that it's a pretty sweet gig if you like the locations (I do).
http://willowtreeapps.com/careers/
Please mention that you saw this on Hacker News if you apply. You can also email me at ian dot terrell at willowtree dot com with any questions.
[0]: https://www.glassdoor.com/Reviews/WillowTree-Reviews-E512911...
[1]: http://fortune.com/best-small-workplaces-in-technology/willo...