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

Keep UITableView ContentOffset to prepend list items #76

Closed
2 tasks done
shimastripe opened this issue Apr 29, 2020 · 2 comments
Closed
2 tasks done

Keep UITableView ContentOffset to prepend list items #76

shimastripe opened this issue Apr 29, 2020 · 2 comments

Comments

@shimastripe
Copy link

Checklist

Expected Behavior

I want to make a timeline like Twitter using Carbon and UITableView.

  • When I continue to load the latest items and append the Component Items in List, UITableView contentOffset works properly. (= keep the current position)
  • When I pull to refresh and prepend Component items in List, UITableView contentOffset moves to top position in List.

Current Behavior

Add to append items.

list = [Component3, Component4, Component5]
appendItems = [Component6, Component7]

I scroll to the latest item Component5.

newList = [Component3, Component4, Component5, Component6, Component7]

and UITableView's contentOffset indicates Component5. Keep current position.

Add to prepend items.

list = [Component3, Component4, Component5]
appendItems = [Component1, Component2]

I pull to refresh.

newList = [Component1, Component2, Component3, Component4, Component5]

and UITableView's contentOffset indicates Component1. Not Component3

Detailed Description (Include Screenshots)

  • I want to resolve latter case. (add to prepend items)
    • UITableView's contentOffset should indicate Component3.
  • Do you have any solutions? Thank you.

Environment

  • Carbon version:
    1.0.0 Release Candidate 6

  • Swift version:
    Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)

  • iOS version:
    13.4.1

  • Xcode version:
    11.4.1

  • Devices/Simulators:
    iPhone11Pro 13.4.1

  • using SPM

@ra1028
Copy link
Owner

ra1028 commented Jun 9, 2020

@shimastripe
Sorry for my late reply.
Carbon provides powerful features but is actually a thin wrapper for UITable/CollectionView.
So there are no plans for Carbon to support any of the features you have suggested for now.
However, you are not limit any solution by Carbon, and I recommend that you implement it according to the existing solution.
Unfortunately, I couldn't be helpful.

@shimastripe
Copy link
Author

@ra1028

I recommend that you implement it according to the existing solution.

OK, I understand and try it.
Thank you for the reply!

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