Skip to content

Paging on iOS: a shared paged-list presenter #370

Closed as not planned
Closed as not planned

Description

@Kaaveh

Part of #356 (Phase 2).

Why

MarketListViewModel.pagedMarketList is a Flow<PagingData<MarketModel>>. Android consumes it with collectAsLazyPagingItems(); SwiftUI has no equivalent.

Scope

  • In a shared module, a small PagedListPresenter<T> built on Paging common's PagingDataPresenter. It exposes:
    • items: StateFlow<List<T>>
    • loadState: StateFlow<CombinedLoadStates>
    • fun get(index: Int), which triggers the next page the way LazyPagingItems[index] does
    • refresh() and retry()
  • SwiftUI's List calls get(index) from onAppear of each row, and .refreshable calls refresh().
  • Android keeps collectAsLazyPagingItems() and doesn't use the presenter.
  • commonTest for the presenter, using TestPager/a fake PagingSource.

Activity

  1. Kaaveh commented on Oct 30, 2026

    @Kaaveh
    OwnerAuthor

    Likely no longer needed. #389 decided to drop Paging for Markets (RD6): the list is the synced top 250, read from Room as a plain Flow<List<Market>>, with filter and sort in the shared ViewModel. #391 deletes MarketsPagingSource, GetPagedMarketListUseCase and the Paging dependencies, so there's no PagingData left for SwiftUI to consume.

    Suggest closing this once #391 is merged.

  2. Kaaveh commented on Nov 1, 2026

    @Kaaveh
    OwnerAuthor

    Not needed: Markets reads the top 250 from Room as a plain list, so there's no Paging to share (#389 RD6, #391).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions