Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional counters #3

Closed
ashfurrow opened this issue Nov 10, 2016 · 1 comment
Closed

Add additional counters #3

ashfurrow opened this issue Nov 10, 2016 · 1 comment

Comments

@ashfurrow
Copy link
Member

The app currently has one counter, it would be super-cool to have multiple ones (for more complex state). I'm thinking the UI could be a table view with a UIStepper as each cell's accessory view. A first-pass implementation would tableView.reloadData on state updates, a more performant approach could be researched and implemented after that.

See ReSwift#7

@Ben-G
Copy link

Ben-G commented Nov 10, 2016

Cool idea! UIStepper sounds like a good solution.

For the list of views I can think of some options:

  1. Your suggestion: UITableView + reloadData is probably the simplest way to go.
  2. With some additional state-diffing (checking which cells got added, removed updated) you could use a React-like wrapper around UITableView. You could take a look at the AutoTable repo, where I've implemented something similar. I believe there are a bunch of other table view diffing libraries out there, i.e. RxDataSources.
  3. State-diffing together with UIStackView. Keep reference to existing views, update individual existing views as state updates come in. Add/remove views from UIStackView as needed.

If you want to build something on your own that requires state-diffing, you can take a look at Dwifft, a simple diffing library that I found pretty useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants