Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Jul 24, 2024
1 parent 90bf34f commit 7d4d2f0
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 658 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodules/swiftui-scrollview-interoperable-drag-gesture"]
path = submodules/swiftui-scrollview-interoperable-drag-gesture
url = https://github.com/FluidGroup/swiftui-scrollview-interoperable-drag-gesture.git
12 changes: 12 additions & 0 deletions Development/Development.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
4B5794852C4FC44B000BC6F9 /* SwiftUISnapDraggingModifier in Frameworks */ = {isa = PBXBuildFile; productRef = 4B5794842C4FC44B000BC6F9 /* SwiftUISnapDraggingModifier */; };
4BCD74E42C51692C00073BFD /* SwiftUIScrollViewInteroperableDragGesture in Frameworks */ = {isa = PBXBuildFile; productRef = 4BCD74E32C51692C00073BFD /* SwiftUIScrollViewInteroperableDragGesture */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -24,6 +25,7 @@
buildActionMask = 2147483647;
files = (
4B5794852C4FC44B000BC6F9 /* SwiftUISnapDraggingModifier in Frameworks */,
4BCD74E42C51692C00073BFD /* SwiftUIScrollViewInteroperableDragGesture in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -67,6 +69,7 @@
name = Development;
packageProductDependencies = (
4B5794842C4FC44B000BC6F9 /* SwiftUISnapDraggingModifier */,
4BCD74E32C51692C00073BFD /* SwiftUIScrollViewInteroperableDragGesture */,
);
productName = Development;
productReference = 4B5794722C4FC3F2000BC6F9 /* Development.app */;
Expand Down Expand Up @@ -98,6 +101,7 @@
mainGroup = 4B5794692C4FC3F2000BC6F9;
packageReferences = (
4B5794832C4FC44B000BC6F9 /* XCLocalSwiftPackageReference "../../swiftui-snap-dragging-modifier" */,
4BCD74E22C51692C00073BFD /* XCLocalSwiftPackageReference "../submodules/swiftui-scrollview-interoperable-drag-gesture" */,
);
productRefGroup = 4B5794732C4FC3F2000BC6F9 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -334,13 +338,21 @@
isa = XCLocalSwiftPackageReference;
relativePath = "../../swiftui-snap-dragging-modifier";
};
4BCD74E22C51692C00073BFD /* XCLocalSwiftPackageReference "../submodules/swiftui-scrollview-interoperable-drag-gesture" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../submodules/swiftui-scrollview-interoperable-drag-gesture";
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
4B5794842C4FC44B000BC6F9 /* SwiftUISnapDraggingModifier */ = {
isa = XCSwiftPackageProductDependency;
productName = SwiftUISnapDraggingModifier;
};
4BCD74E32C51692C00073BFD /* SwiftUIScrollViewInteroperableDragGesture */ = {
isa = XCSwiftPackageProductDependency;
productName = SwiftUIScrollViewInteroperableDragGesture;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 4B57946A2C4FC3F2000BC6F9 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "4acd72ea7b49774b48d1ab427d62c847813cdf43b4cb0a262352735d0dc48e5f",
"originHash" : "bf69f78dc379b70fc68829e1f8cba58518fbec4de48b39f78f417eb30a455bfa",
"pins" : [
{
"identity" : "swift-rubber-banding",
Expand Down
1 change: 1 addition & 0 deletions Development/Development/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct Joystick: View {
.frame(width: 100, height: 100)
.modifier(
SnapDraggingModifier(
gestureMode: .normal,
offset: $offset,
springParameter: .interpolation(mass: 1, stiffness: 1, damping: 1)
)
Expand Down
4 changes: 3 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/FluidGroup/swiftui-support", from: "0.9.0"),
.package(url: "https://github.com/FluidGroup/swift-rubber-banding", from: "1.0.0")
.package(url: "https://github.com/FluidGroup/swift-rubber-banding", from: "1.0.0"),
.package(url: "https://github.com/FluidGroup/swiftui-scrollview-interoperable-drag-gesture", from: "0.1.0")
],
targets: [
.target(
Expand All @@ -23,6 +24,7 @@ let package = Package(
.product(name: "RubberBanding", package: "swift-rubber-banding"),
.product(name: "SwiftUISupportSizing", package: "swiftui-support"),
.product(name: "SwiftUISupportGeometryEffect", package: "swiftui-support"),
.product(name: "SwiftUIScrollViewInteroperableDragGesture", package: "swiftui-scrollview-interoperable-drag-gesture"),
]
),
.testTarget(
Expand Down
7 changes: 7 additions & 0 deletions Sources/SwiftUISnapDraggingModifier/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public struct SheetModifier<DisplayContent: View>: ViewModifier {
.fixedSize(horizontal: false, vertical: true)
.modifier(
SnapDraggingModifier(
gestureMode: {
if #available(iOS 18.0, *) {
return .scrollViewInteroperable(.init(ignoresScrollView: false, sticksToEdges: true))
} else {
return .normal
}
}(),
offset: $contentOffset,
axis: .vertical,
verticalBoundary: .init(min: 0, max: .infinity, bandLength: 50),
Expand Down
Loading

0 comments on commit 7d4d2f0

Please sign in to comment.