Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version #7

Merged
merged 15 commits into from
Jun 2, 2021
Merged

New version #7

merged 15 commits into from
Jun 2, 2021

Conversation

lucaszischka
Copy link
Owner

@lucaszischka lucaszischka commented May 23, 2021

I'm currently working on a new version, where I want to implement a new options system; below are the positive and negative aspect discussed, your feedback is welcomed.

Example Syntax

HomeView()
    .bottomSheet(bottomSheetPosition: self.$bottomSheetPosition, options: [.noDragIndicator, .showCloseButton(action: { /*Action*/ }), .notResizeable]

Pro

  • Fewer transferring parameters, since everything is defined as enum cases in the options
  • A cleaner and more understandable syntax, as there are fewer transfer parameters
  • Better solution for the showCancelButton and closeAction problem, because they weren't connected them up to now (you could specify a close action without a close button XD)
  • Easier to expand in the future, as no code breaks when an enum case gets added
  • More apples style

Contra

  • You can specify the same enum case several times, which can lead to problems with showCloseButton (() -> Void)
  • Every previous code is broken because the previous parameters are dropped

Accepted

Undecided

Declined

  • Add threshold for dragToDismiss (see Adding blur background or dim #8). (Reason: The current implementation doesn't need a threshold, because it is dynamic. It uses the flick through feature to decide when it should get dismissed.)
  • Make BottomSheet not go above 100% (see Adding blur background or dim #8) (Reason: If the BottomSheet gets dragged above the full screen height(100%), it snaps back to the highest value in the BottomSheetPosition enum. And because no value should be above 1, it will never be unreachable.)

- Split files (ViewExtension)
- Reorganised Files
- New Options System (less parameter)
-
- Change Resizable to notResizeable
- Add noDragIndicator option
- Fix Initialiser
- Fix Assets links in Readme
- Set empty array to default for options
- Set nil returning closure to default for headerContent
- Remove super fluent nil default
@lucaszischka lucaszischka linked an issue May 23, 2021 that may be closed by this pull request
@lucaszischka lucaszischka self-assigned this May 23, 2021
@lucaszischka lucaszischka added documentation Improvements or additions to documentation enhancement New feature or request labels May 23, 2021
This was referenced May 27, 2021
This was linked to issues May 27, 2021
@lucaszischka
Copy link
Owner Author

I will now merge this pull request, even if not all features have been implemented. All features that are missing are now moved to #11 and will be worked on in future.

@lucaszischka lucaszischka merged commit 6dfbe16 into main Jun 2, 2021
@lucaszischka lucaszischka deleted the new-version branch June 2, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add background param as View . Adding blur background or dim Dragging inner content
1 participant