새로운 콘텐츠 전체보기, 콘텐츠 큐레이션 전체보기 - 스크롤 로딩 추가

This commit is contained in:
Yu Sung 2023-09-27 21:22:26 +09:00
parent 658cff20eb
commit f653667df2
2 changed files with 14 additions and 4 deletions

View File

@ -60,8 +60,13 @@ struct ContentNewAllView: View {
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 13.3) {
ForEach(0..<viewModel.newContentList.count, id: \.self) {
ContentNewAllItemView(item: viewModel.newContentList[$0])
ForEach(0..<viewModel.newContentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.newContentList[index])
.onAppear {
if index == viewModel.newContentList.count - 1 {
viewModel.getNewContentList()
}
}
}
}
}

View File

@ -90,8 +90,13 @@ struct ContentCurationView: View {
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 13.3) {
ForEach(0..<viewModel.contentList.count, id: \.self) {
ContentNewAllItemView(item: viewModel.contentList[$0])
ForEach(0..<viewModel.contentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.contentList[index])
.onAppear {
if index == viewModel.contentList.count - 1 {
viewModel.getContentList()
}
}
}
}
}