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

[SwiftUI] UIViewControllerRepresentable #627

Open
Taehyeong-Jo opened this issue Apr 26, 2024 · 1 comment
Open

[SwiftUI] UIViewControllerRepresentable #627

Taehyeong-Jo opened this issue Apr 26, 2024 · 1 comment

Comments

@Taehyeong-Jo
Copy link

Description

Currently, we are working on converting to SwiftUI.
After wrapping the MyViewController created using FloatingPanelController with UIViewControllerRepresentable
When I call it from SwiftUI, it doesn't work properly.


Expected behavior

View should appear properly.


Actual behavior

View is not visible.


Steps to reproduce

https://github.com/Taehyeong-Jo/FloatingPanelTest
This is a sample project.



How do you display panel(s)?

  • Add as child view controllers
  • Present modally

How many panels do you displays?

  • 1

Environment

Library version
v 2.8.2


Installation method
SPM

iOS version(s)
iOS 17.4.1

Xcode version
15.3

@scenee
Copy link
Owner

scenee commented May 11, 2024

We can't use FloatingPanelController with UIViewControllerRepresentable directly in SwiftUI. Because FloatingPanelController needs to be added into a parent view controller.

Maps-SwiftUI sample code is very helpful to use it in SwiftUI. It defines FloatingPanelView to wrap FloatingPanelController with a UIHostingViewController to resolve the restriction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants