Skip to content

Commit

Permalink
Sample project updated to last version
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Moya de Rivas committed Jan 23, 2020
1 parent 3b05829 commit ddea9f8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -32,7 +32,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6BB892CF23D9DE2100AC9331 /* SwiftUIPager in Frameworks */,
6BB892E023D9F13C00AC9331 /* SwiftUIPager in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -94,7 +94,7 @@
);
name = Sample;
packageProductDependencies = (
6BB892CE23D9DE2100AC9331 /* SwiftUIPager */,
6BB892DF23D9F13C00AC9331 /* SwiftUIPager */,
);
productName = SwiftUIPager;
productReference = 17D9E0F023D4CF6700C5AE93 /* Sample.app */;
Expand Down Expand Up @@ -125,7 +125,7 @@
);
mainGroup = 17D9E0E723D4CF6700C5AE93;
packageReferences = (
6BB892CD23D9DE2100AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */,
6BB892DE23D9F13C00AC9331 /* XCRemoteSwiftPackageReference "SwiftUIPager" */,
);
productRefGroup = 17D9E0F123D4CF6700C5AE93 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -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 = {
Expand All @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/fermoya/SwiftUIPager",
"state": {
"branch": "fix/page-offset",
"revision": "1baa9dc59fa3418e5326413c224dbc788cb616f9",
"revision": "3b05829020ec5e10a0997455b2a7fb18dfb4af53",
"version": null
}
}
Expand Down
16 changes: 14 additions & 2 deletions Sample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit ddea9f8

Please sign in to comment.