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

In addition to handling drag gesture changes & ending, also handle ca… #149

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

juhieta
Copy link
Contributor

@juhieta juhieta commented Dec 12, 2023

…ncelled drag gesture. Fixes #148.

@lucaszischka
Copy link
Owner

Hello Jukka Hietanen,
first of all, thank you for taking the time to fix this issue yourself. ❤️
Im currently very busy, so I don't have time to test this PR; however the code LGTM and after you fix the MacOS build I will merge it into main. Also consider adding

v3.1.2

to CHANGELOG.md.

Anyway, I will not release a new version until I had time to test it. This means for you (or anyone else having this issue), that you will either have to use the main branch or your current fork.

Sorry for the inconvenience and thank you very much for helping me out!

Greetings from Munich,
Lucas

@zchwyng
Copy link

zchwyng commented Feb 13, 2024

Thanks! ❤️❤️ Can we get this merged? This bug makes dragging from the bottom pretty much a no go, imho. I've tested it on a real device with iOS 17.3.1 on an iPhone 12 mini and a bunch of different iPhone and iPad simulators with iOS 17.0. I will try this in production on a small user base.

@fickledogfish
Copy link

@juhieta could you apply this patch to the PR? It should fix the macOS build. 😺

diff --git a/Sources/BottomSheet/Helper/Extensions/ViewExtension.swift b/Sources/BottomSheet/Helper/Extensions/ViewExtension.swift
index 4a49adf..689f760 100644
--- a/Sources/BottomSheet/Helper/Extensions/ViewExtension.swift
+++ b/Sources/BottomSheet/Helper/Extensions/ViewExtension.swift
@@ -13,7 +13,7 @@ import Combine
 internal extension View {
     /// A backwards compatible wrapper for iOS 14 onChange
     @ViewBuilder func valueChanged<T: Equatable>(value: T, onChange: @escaping (T) -> Void) -> some View {
-        if #available(iOS 14.0, *) {
+        if #available(iOS 14.0, macOS 11.0, *) {
             self.onChange(of: value, perform: onChange)
         } else {
             self.onReceive(Just(value)) { (value) in

@juhieta
Copy link
Contributor Author

juhieta commented Feb 20, 2024

Hi, sorry about delay and will do asap! 😊

@juhieta
Copy link
Contributor Author

juhieta commented Feb 21, 2024

Now pushed the macOS fix @fickledogfish. @lucaszischka can this now be merged to main?

@lucaszischka lucaszischka merged commit 7af4bb2 into lucaszischka:main Feb 21, 2024
2 checks passed
@juhieta juhieta deleted the handle-drag-cancellation branch February 22, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants