Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Development/Development.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
4B08E0AB2CF5805500B05999 /* BookScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B08E0AA2CF5805200B05999 /* BookScrollView.swift */; };
4B08E0AD2CF5947100B05999 /* ScrollTracking in Frameworks */ = {isa = PBXBuildFile; productRef = 4B08E0AC2CF5947100B05999 /* ScrollTracking */; };
4B26A67B2A33239500B75FB4 /* DevelopmentApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B26A67A2A33239500B75FB4 /* DevelopmentApp.swift */; };
4B26A67D2A33239500B75FB4 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B26A67C2A33239500B75FB4 /* ContentView.swift */; };
4B26A67F2A33239600B75FB4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B26A67E2A33239600B75FB4 /* Assets.xcassets */; };
Expand Down Expand Up @@ -39,6 +41,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
4B08E0AA2CF5805200B05999 /* BookScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookScrollView.swift; sourceTree = "<group>"; };
4B26A6772A33239500B75FB4 /* Development.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Development.app; sourceTree = BUILT_PRODUCTS_DIR; };
4B26A67A2A33239500B75FB4 /* DevelopmentApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevelopmentApp.swift; sourceTree = "<group>"; };
4B26A67C2A33239500B75FB4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand All @@ -59,6 +62,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4B08E0AD2CF5947100B05999 /* ScrollTracking in Frameworks */,
4BC34FAF2CDB1B9200D22811 /* CollectionView in Frameworks */,
4BEAFA4E2A3CE48800478C59 /* AsyncMultiplexImage-Nuke in Frameworks */,
4BEAFA4C2A3CE48800478C59 /* AsyncMultiplexImage in Frameworks */,
Expand Down Expand Up @@ -91,6 +95,7 @@
4B26A6792A33239500B75FB4 /* Development */ = {
isa = PBXGroup;
children = (
4B08E0AA2CF5805200B05999 /* BookScrollView.swift */,
4BC34FB02CDB1C0500D22811 /* BookCollectionView.swift */,
4B26A67A2A33239500B75FB4 /* DevelopmentApp.swift */,
4B26A67C2A33239500B75FB4 /* ContentView.swift */,
Expand Down Expand Up @@ -144,6 +149,7 @@
4BEAFA4B2A3CE48800478C59 /* AsyncMultiplexImage */,
4BEAFA4D2A3CE48800478C59 /* AsyncMultiplexImage-Nuke */,
4BC34FAE2CDB1B9200D22811 /* CollectionView */,
4B08E0AC2CF5947100B05999 /* ScrollTracking */,
);
productName = Development;
productReference = 4B26A6772A33239500B75FB4 /* Development.app */;
Expand Down Expand Up @@ -209,6 +215,7 @@
4B3722682A33C701005FF24A /* BookUIKitBasedCompositional.swift in Sources */,
4BD04C172B2C13BB00FE41D9 /* Logger.swift in Sources */,
4BD04C192B2C15E100FE41D9 /* Color.swift in Sources */,
4B08E0AB2CF5805500B05999 /* BookScrollView.swift in Sources */,
4BC34FB12CDB1C0C00D22811 /* BookCollectionView.swift in Sources */,
4BD04C152B2C05C600FE41D9 /* BookPlainCollectionView.swift in Sources */,
4B910EBC2A77A2F50079D26D /* BookUIKitBasedFlow.swift in Sources */,
Expand Down Expand Up @@ -348,7 +355,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
IPHONEOS_DEPLOYMENT_TARGET = 16;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -378,7 +385,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
IPHONEOS_DEPLOYMENT_TARGET = 16;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -435,6 +442,10 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
4B08E0AC2CF5947100B05999 /* ScrollTracking */ = {
isa = XCSwiftPackageProductDependency;
productName = ScrollTracking;
};
4B9981D72A34F9B500840751 /* CompositionKit */ = {
isa = XCSwiftPackageProductDependency;
package = 4B9981D62A34F9B500840751 /* XCRemoteSwiftPackageReference "CompositionKit" */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions Development/Development/BookScrollView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// BookScrollView.swift
// Development
//
// Created by Muukii on 2024/11/26.
//

import SwiftUI
import ScrollTracking


struct OnAdditionalLoading_Previews: View, PreviewProvider {

@State var items: [Int] = (0..<100).map { $0 }
@State var isLoading: Bool = false

var body: some View {
ScrollView {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))]) {
ForEach(items, id: \.self) { index in
Text("Item \(index)")
.font(.title)
}
}
if isLoading {
Text(isLoading ? "Loading..." : "End")
}
}
.onAdditionalLoading(isLoading: $isLoading) {
print("👨🏻 load")
try? await Task.sleep(for: .seconds(1))
items.append(contentsOf: (items.count..<(items.count + 100)).map { $0 })
print("appended")
}
}

static var previews: some View {
Self()
}
}


4 changes: 4 additions & 0 deletions Development/Development/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ struct ContentView: View {
NavigationLink("CollectionView") {
BookCollectionViewSingleSection()
}

NavigationLink("ScrollView") {
OnAdditionalLoading_Previews()
}
}
}
}
Expand Down
20 changes: 19 additions & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ let package = Package(
.library(
name: "CollectionView",
targets: ["CollectionView"]
)
),
.library(
name: "ScrollTracking",
targets: ["ScrollTracking"]
),
],
dependencies: [
.package(url: "https://github.com/FluidGroup/swift-indexed-collection", from: "0.2.1"),
.package(url: "https://github.com/siteline/swiftui-introspect", from: "1.3.0"),
.package(url: "https://github.com/FluidGroup/swift-with-prerender", from: "1.0.0")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -34,9 +40,17 @@ let package = Package(
.product(name: "IndexedCollection", package: "swift-indexed-collection"),
]
),
.target(
name: "ScrollTracking",
dependencies: [
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),
.product(name: "WithPrerender", package: "swift-with-prerender"),
]
),
.testTarget(
name: "DynamicListTests",
dependencies: ["DynamicList"]
),
]
],
swiftLanguageModes: [.v6]
)
Loading