Skip to content

Commit

Permalink
Feat/bottom sheet plus alpha (#17)
Browse files Browse the repository at this point in the history
* fix: implement missing updateUIViewController and safely unwrap position

* feat: included manually disable drag and exclude positions

* fix: small fix to prevent scrollview from snapping back to initial position after dragging

* fix: fixed a bug where values would not compare due to rounding issues

* fix: added example overview and included small updateview bugfixes

* feat: groundwork for v2 of the bottomsheet

* feat: work in progress for new bottom sheet interface

* fix: added missing view modifiers

* feat: included dragging on scroll section

* fix: fixed wrong height on detents

* fix: patched snapping issue on fractions

* fix: fix on height detent

* feat: included translation callback

* feat: added custom animation curve support

* feat: small fixes and included background on sheet

* fix: link background as background property

* feat: including examples back in and adding swiftlint

* fix: fixed example issues on the new bottomsheet configuration

* chore: more clean up and small UI refinements

* feat: example refactor for scalability

* fix: implementation of working top level lists rendering

* fix: attempting to fix list inside the sheet

* chore: prepare bottomsheet plus for alpha release

* chore: rebase to main

* fix: updated readme to resemble new bottomsheet configuration
  • Loading branch information
Wouter125 authored Jun 14, 2023
1 parent 44ab410 commit 788a0fd
Show file tree
Hide file tree
Showing 27 changed files with 898 additions and 838 deletions.
84 changes: 51 additions & 33 deletions Example/BottomSheetExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@
objects = {

/* Begin PBXBuildFile section */
6C0B59F127DAB989006D979A /* BottomSheet in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0B59F027DAB989006D979A /* BottomSheet */; };
6C0BD46D27DA862D000AF3CD /* BottomSheetExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C0BD46C27DA862D000AF3CD /* BottomSheetExampleApp.swift */; };
6C0BD46F27DA862D000AF3CD /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C0BD46E27DA862D000AF3CD /* ContentView.swift */; };
6C0BD47127DA862D000AF3CD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6C0BD47027DA862D000AF3CD /* Assets.xcassets */; };
6C0BD47427DA862D000AF3CD /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6C0BD47327DA862D000AF3CD /* Preview Assets.xcassets */; };
6C6EB0B6292AEADC00106A1D /* BottomSheet in Frameworks */ = {isa = PBXBuildFile; productRef = 6C6EB0B5292AEADC00106A1D /* BottomSheet */; };
6C763147283D774500463709 /* ExampleOverview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C763146283D774500463709 /* ExampleOverview.swift */; };
6CDF5A0D27ED33C7004609F4 /* CornerRadius.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CDF5A0C27ED33C7004609F4 /* CornerRadius.swift */; };
6CF78515293D36FB000E6581 /* StocksExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF78514293D36FB000E6581 /* StocksExample.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
6C0BD46927DA862D000AF3CD /* BottomSheetExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BottomSheetExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
6C0BD46C27DA862D000AF3CD /* BottomSheetExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomSheetExampleApp.swift; sourceTree = "<group>"; };
6C0BD46E27DA862D000AF3CD /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
6C0BD47027DA862D000AF3CD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6C0BD47327DA862D000AF3CD /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
6C1DE0102889CF10003C6EE9 /* BottomSheet */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = BottomSheet; path = ..; sourceTree = "<group>"; };
6C763146283D774500463709 /* ExampleOverview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleOverview.swift; sourceTree = "<group>"; };
6CDF5A0C27ED33C7004609F4 /* CornerRadius.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CornerRadius.swift; sourceTree = "<group>"; };
6CF78514293D36FB000E6581 /* StocksExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StocksExample.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
6C0BD46627DA862D000AF3CD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6C0B59F127DAB989006D979A /* BottomSheet in Frameworks */,
6C6EB0B6292AEADC00106A1D /* BottomSheet in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -41,6 +42,7 @@
6C0BD46027DA862C000AF3CD = {
isa = PBXGroup;
children = (
6C1DE0102889CF10003C6EE9 /* BottomSheet */,
6C0BD46B27DA862D000AF3CD /* BottomSheetExample */,
6C0BD46A27DA862D000AF3CD /* Products */,
6C0BD47A27DA87A1000AF3CD /* Frameworks */,
Expand All @@ -60,7 +62,7 @@
children = (
6C0BD46C27DA862D000AF3CD /* BottomSheetExampleApp.swift */,
6C763146283D774500463709 /* ExampleOverview.swift */,
6C0BD46E27DA862D000AF3CD /* ContentView.swift */,
6CF78516293D3703000E6581 /* Apple Applications */,
6CDF5A0E27ED33D3004609F4 /* View Modifiers */,
6C0BD47027DA862D000AF3CD /* Assets.xcassets */,
6C0BD47227DA862D000AF3CD /* Preview Content */,
Expand Down Expand Up @@ -91,6 +93,14 @@
path = "View Modifiers";
sourceTree = "<group>";
};
6CF78516293D3703000E6581 /* Apple Applications */ = {
isa = PBXGroup;
children = (
6CF78514293D36FB000E6581 /* StocksExample.swift */,
);
path = "Apple Applications";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -100,6 +110,7 @@
buildPhases = (
6C0BD46527DA862D000AF3CD /* Sources */,
6C0BD46627DA862D000AF3CD /* Frameworks */,
6C939DBE294DFF9200F6EF50 /* Swiftlint */,
6C0BD46727DA862D000AF3CD /* Resources */,
);
buildRules = (
Expand All @@ -108,7 +119,7 @@
);
name = BottomSheetExample;
packageProductDependencies = (
6C0B59F027DAB989006D979A /* BottomSheet */,
6C6EB0B5292AEADC00106A1D /* BottomSheet */,
);
productName = BottomSheetExample;
productReference = 6C0BD46927DA862D000AF3CD /* BottomSheetExample.app */;
Expand Down Expand Up @@ -139,7 +150,6 @@
);
mainGroup = 6C0BD46027DA862C000AF3CD;
packageReferences = (
6C0B59EF27DAB989006D979A /* XCRemoteSwiftPackageReference "BottomSheet" */,
);
productRefGroup = 6C0BD46A27DA862D000AF3CD /* Products */;
projectDirPath = "";
Expand All @@ -162,15 +172,37 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
6C939DBE294DFF9200F6EF50 /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftlint;
outputFileListPaths = (
);
outputPaths = (
);
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";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
6C0BD46527DA862D000AF3CD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6C0BD46F27DA862D000AF3CD /* ContentView.swift in Sources */,
6C0BD46D27DA862D000AF3CD /* BottomSheetExampleApp.swift in Sources */,
6CDF5A0D27ED33C7004609F4 /* CornerRadius.swift in Sources */,
6C763147283D774500463709 /* ExampleOverview.swift in Sources */,
6CF78515293D36FB000E6581 /* StocksExample.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -300,17 +332,16 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"BottomSheetExample/Preview Content\"";
DEVELOPMENT_TEAM = JU6AZT44CN;
DEVELOPMENT_ASSET_PATHS = "BottomSheetExample/Preview\\ Content";
DEVELOPMENT_TEAM = KZAMEFAGHT;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -320,7 +351,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -331,17 +362,16 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"BottomSheetExample/Preview Content\"";
DEVELOPMENT_TEAM = JU6AZT44CN;
DEVELOPMENT_ASSET_PATHS = "BottomSheetExample/Preview\\ Content";
DEVELOPMENT_TEAM = KZAMEFAGHT;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -351,7 +381,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand All @@ -378,21 +408,9 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
6C0B59EF27DAB989006D979A /* XCRemoteSwiftPackageReference "BottomSheet" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Wouter125/BottomSheet";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.1;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
6C0B59F027DAB989006D979A /* BottomSheet */ = {
6C6EB0B5292AEADC00106A1D /* BottomSheet */ = {
isa = XCSwiftPackageProductDependency;
package = 6C0B59EF27DAB989006D979A /* XCRemoteSwiftPackageReference "BottomSheet" */;
productName = BottomSheet;
};
/* End XCSwiftPackageProductDependency section */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6C0BD46827DA862D000AF3CD"
BuildableName = "BottomSheetExample.app"
BlueprintName = "BottomSheetExample"
ReferencedContainer = "container:BottomSheetExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6C0BD46827DA862D000AF3CD"
BuildableName = "BottomSheetExample.app"
BlueprintName = "BottomSheetExample"
ReferencedContainer = "container:BottomSheetExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6C0BD46827DA862D000AF3CD"
BuildableName = "BottomSheetExample.app"
BlueprintName = "BottomSheetExample"
ReferencedContainer = "container:BottomSheetExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit 788a0fd

Please sign in to comment.