diff --git a/Sample.xcodeproj/project.pbxproj b/Sample.xcodeproj/project.pbxproj index e71575e..4f21ba8 100644 --- a/Sample.xcodeproj/project.pbxproj +++ b/Sample.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 17D9E0FA23D4CF6900C5AE93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17D9E0F923D4CF6900C5AE93 /* Assets.xcassets */; }; 17D9E0FD23D4CF6900C5AE93 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17D9E0FC23D4CF6900C5AE93 /* Assets.xcassets */; }; 17D9E10023D4CF6900C5AE93 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17D9E0FE23D4CF6900C5AE93 /* LaunchScreen.storyboard */; }; - 6BB892CF23D9DE2100AC9331 /* SwiftUIPager in Frameworks */ = {isa = PBXBuildFile; productRef = 6BB892CE23D9DE2100AC9331 /* SwiftUIPager */; }; + 6BB892E023D9F13C00AC9331 /* SwiftUIPager in Frameworks */ = {isa = PBXBuildFile; productRef = 6BB892DF23D9F13C00AC9331 /* SwiftUIPager */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -32,7 +32,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6BB892CF23D9DE2100AC9331 /* SwiftUIPager in Frameworks */, + 6BB892E023D9F13C00AC9331 /* SwiftUIPager in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,7 +94,7 @@ ); name = Sample; packageProductDependencies = ( - 6BB892CE23D9DE2100AC9331 /* SwiftUIPager */, + 6BB892DF23D9F13C00AC9331 /* SwiftUIPager */, ); productName = SwiftUIPager; productReference = 17D9E0F023D4CF6700C5AE93 /* Sample.app */; @@ -125,7 +125,7 @@ ); mainGroup = 17D9E0E723D4CF6700C5AE93; packageReferences = ( - 6BB892CD23D9DE2100AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */, + 6BB892DE23D9F13C00AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */, ); productRefGroup = 17D9E0F123D4CF6700C5AE93 /* Products */; projectDirPath = ""; @@ -352,7 +352,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 6BB892CD23D9DE2100AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */ = { + 6BB892DE23D9F13C00AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/fermoya/SwiftUIPager"; requirement = { @@ -363,9 +363,9 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 6BB892CE23D9DE2100AC9331 /* SwiftUIPager */ = { + 6BB892DF23D9F13C00AC9331 /* SwiftUIPager */ = { isa = XCSwiftPackageProductDependency; - package = 6BB892CD23D9DE2100AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */; + package = 6BB892DE23D9F13C00AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */; productName = SwiftUIPager; }; /* End XCSwiftPackageProductDependency section */ diff --git a/Sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d8f18eb..bea2a7f 100644 --- a/Sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/fermoya/SwiftUIPager", "state": { "branch": "fix/page-offset", - "revision": "1baa9dc59fa3418e5326413c224dbc788cb616f9", + "revision": "3b05829020ec5e10a0997455b2a7fb18dfb4af53", "version": null } } diff --git a/Sample/ContentView.swift b/Sample/ContentView.swift index 18e5a55..a631980 100644 --- a/Sample/ContentView.swift +++ b/Sample/ContentView.swift @@ -14,11 +14,22 @@ extension Int: Identifiable { } struct ContentView: View { - + + @State var isPresented: Bool = false @State var pageIndex: Int = 0 var data: [Int] = Array((0...20)) var body: some View { + Button(action: { + self.isPresented.toggle() + }, label: { + Text("Tap me") + }).sheet(isPresented: $isPresented, content: { + self.presentedView + }) + } + + var presentedView: some View { GeometryReader { proxy in ScrollView { VStack { @@ -32,7 +43,8 @@ struct ContentView: View { .interactive(0.8) .itemSpacing(10) .padding(8) - .itemAspectRatio(1.5) + .itemAspectRatio(0.8) + .itemTappable(true) .frame(width: min(proxy.size.width, proxy.size.height), height: min(proxy.size.width,