-
Notifications
You must be signed in to change notification settings - Fork 68
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
SwiftUI integration #62
Comments
The problem with all the SwiftUI solutions is, that they cannot contain a scrollview and still be able to move the sheet when dragging. |
@philipholler SwiftUI has a ".sheet" extension which works great. You don't need to rely on any 3rd party sheet lib in SwiftUI. Please see the official doc: |
Yes, the SwiftUI sheet works great in situations where you only need two state, that is cover the entire screen og dismissed. In case one needs 3 States, however, (for example like in apple maps), it is not usable. Additionally the SwiftUI sheet pushes back the rest of the views like a modal. This can also not be disabled |
Ah ok. I will look into this thoroughly. |
That sounds great. Please let me know, if there’s anything i can help with :-) |
Hi! Any updates on that? Do you (@OfTheWolf @philipholler) know newer/current alternatives for SwiftUI? Thanks a lot in advance :) |
Hi @thomasmo3 @philipholler, I couldn't have a chance to look at this. I can recommend https://github.com/applidium/OverlayContainer for Swift UI support. Thanks |
If you want SwiftUI content inside of UBottomSheet with scrolling: I did that. So far it works fine. The main trick is to use a a UIKit UIScrollView. The UIScrollView contains a UIView that contains a UIHostingController that contains SwiftUI. This way, UBottomSheet has its UIScrollView to work with and does not know that it handles SwiftUI content. The SwiftUI code must not come with a ScrollView or anything else that scrolls. There are still good reasons to use UBottomSheet. |
Hi OfTheWolf,
This package looks great!
Is there any way to integrate it into an app with SwiftUI?
Maybe using UIViewControllerRepresentable?
I can't seem to find any package delivering the same functionality as this for SwiftUI
The text was updated successfully, but these errors were encountered: