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

[Feature] Reactive Collection View Controller #50

Open
royhsu opened this issue Sep 26, 2018 · 4 comments
Open

[Feature] Reactive Collection View Controller #50

royhsu opened this issue Sep 26, 2018 · 4 comments

Comments

@royhsu
Copy link
Owner

royhsu commented Sep 26, 2018

The current implementation of collection view controller relays on the reactiveness from its storage.

But there are some potential problems need to be well-considered.

  1. If there was an input signal returned by leaf views, should the controller keep automatically reloading mechanism?
  2. If we do keep auto-reload, should a storage provide the way to silently update its internal data?
  3. If we silently update the storage, the other views react from the upstream wouldn't receive any updates. It might cause problems too.
@royhsu
Copy link
Owner Author

royhsu commented Sep 26, 2018

Maybe the better choice is to keep updating all views if any changes come from the upstream storage.
And not provide the way to silently update the storage.

Therefore, we should find a good mechanism to update with the minimum efforts by differentiating the changes.

@royhsu
Copy link
Owner Author

royhsu commented Sep 26, 2018

There is an additional side-effect while the storage updates cause UI refreshing.
The lastly first responder will resign because it got deallocated during re-creating a new one.

@royhsu
Copy link
Owner Author

royhsu commented Sep 26, 2018

The collection view controller may need to track which is the current responder and re-activate it while reloading UI.

@royhsu
Copy link
Owner Author

royhsu commented Sep 26, 2018

Try to store isFirstResponder property inside the parent storage but not works properly.

  1. The views have no idea it's been presented on visible cells so they can't make themself become the first responder at right moment. (No viewDidLoad, viewWillAppear...)
  2. Still a complex task to update the isFirstReponsder property of all children storage from the parent if parent try to resign the first responder.

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

1 participant