I'm running a simplified example to test for my purpose;
var body: some View {
GeometryReader { proxy in
VStack(spacing: 10) {
Pager(page: self.page1,
data: self.data1,
id: \.self) {
self.pageView($0)
}
.contentLoadingPolicy(.lazy(recyclingRatio: 2)) // more problem with the eager policy
.pagingPriority(.simultaneous)
.sensitivity(.high)
.itemSpacing(10)
}
}
}
with additionally printing page requests
func pageView(_ page: Int) -> some View {
print("Page request for \(page)")
gettting
App State: inactive
Page request for 0
Page request for 0
Page request for 1
Page request for 1
App State: active
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 0
Page request for 1
Page request for 2
Page request for 2
Expected behavior
It seams that the slower the page transitions the more page request exist. I want a single call since each of the pages get data from the database, for each call, the database query will be executed again.
Environment:
OSX: IOS 16.2
Device : iPhone 14 pro emulator
SwiftUIPager version : Main ( sorry, couldn't find a way to see the version numbering on the package)
Additional context
Is there a way to only load/prepare the neighbor pages with only one call per page?
Describe the bug
I'm running a simplified example to test for my purpose;
with additionally printing page requests
gettting
Expected behavior
It seams that the slower the page transitions the more page request exist. I want a single call since each of the pages get data from the database, for each call, the database query will be executed again.
Environment:
Additional context
Is there a way to only load/prepare the neighbor pages with only one call per page?