Skip to content
16 changes: 10 additions & 6 deletions Example/BottomSheetExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastUpgradeCheck = 1320;
LastUpgradeCheck = 1510;
TargetAttributes = {
6C0BD46827DA862D000AF3CD = {
CreatedOnToolsVersion = 13.2.1;
Expand Down Expand Up @@ -201,7 +201,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint --fix && swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -258,6 +258,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -272,7 +273,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -319,6 +320,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -327,7 +329,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -347,6 +349,7 @@
DEVELOPMENT_ASSET_PATHS = "BottomSheetExample/Preview\\ Content";
DEVELOPMENT_TEAM = KZAMEFAGHT;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand All @@ -359,7 +362,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.chargetrip.BottomSheetExample;
PRODUCT_BUNDLE_IDENTIFIER = com.test.BottomSheetExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -377,6 +380,7 @@
DEVELOPMENT_ASSET_PATHS = "BottomSheetExample/Preview\\ Content";
DEVELOPMENT_TEAM = KZAMEFAGHT;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand All @@ -389,7 +393,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.chargetrip.BottomSheetExample;
PRODUCT_BUNDLE_IDENTIFIER = com.test.BottomSheetExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ struct StocksExample: View {

var body: some View {
VStack {
Button("Close") {
settings.isPresented.toggle()
}

Button("Change") {
settings.selectedDetent = .large
}
Expand All @@ -26,6 +22,7 @@ struct StocksExample: View {
.navigationTitle("\(settings.translation.rounded())")
.onAppear {
settings.isPresented = true
settings.selectedDetent = .medium
settings.activeSheetType = .stocks
}
}
Expand All @@ -43,7 +40,6 @@ struct StocksHeader: View {
Text("From Yahoo Finance")
.foregroundColor(Color(UIColor.secondaryLabel))
}
.padding(.top, 10)
.padding(.bottom, 16)

Spacer()
Expand Down
20 changes: 13 additions & 7 deletions Example/BottomSheetExample/ExampleOverview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,24 @@ struct ExampleOverview: View {
[.height(244), .medium, .large],
selection: $settings.selectedDetent
)
.presentationBackgroundInteractionPlus(.automatic)
.presentationBackgroundPlus {
Color(UIColor.secondarySystemBackground)
}
.presentationCornerRadiusPlus(cornerRadius: 12)
case .staticScrollView:
StaticScrollViewContent()
.presentationDetentsPlus(
[.height(244), .height(380), .height(480), .large],
[.height(380), .height(480), .large],
selection: $settings.selectedDetent
)
.presentationBackgroundInteractionPlus(.enabled(upThrough: .medium))
.presentationBackgroundPlus {
Color(UIColor.red)
}
.presentationCornerRadiusPlus(cornerRadius: 12)
.presentationDragIndicatorPlus(.visible)
.presentationBackgroundInteractionPlus(.enabled(upThrough: .height(380)))
.interactiveDismissDisabledPlus(false)
default:
EmptyView()
}
Expand All @@ -77,18 +87,14 @@ struct ExampleOverview: View {
.onAppear {
settings.isPresented = false
settings.activeSheetType = .home
settings.selectedDetent = .medium
settings.selectedDetent = .height(.zero)
}
}
.navigationViewStyle(.stack)
}
.environmentObject(settings)
.sheetPlus(
isPresented: $settings.isPresented,
background: (
Color(UIColor.secondarySystemBackground)
.cornerRadius(12, corners: [.topLeft, .topRight])
),
onDrag: { translation in
settings.translation = translation
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct StaticScrollViewExample: View {

var body: some View {
VStack {
Button("Close") {
Button(settings.isPresented ? "Close" : "Show") {
settings.isPresented.toggle()
}

Expand All @@ -25,6 +25,7 @@ struct StaticScrollViewExample: View {
.navigationTitle("\(settings.translation.rounded())")
.onAppear {
settings.isPresented = true
settings.selectedDetent = .medium
settings.activeSheetType = .staticScrollView
}
}
Expand Down
Loading