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

CocoaHostingController not working #386

Closed
beachcitiessoftware opened this issue Aug 15, 2022 · 1 comment
Closed

CocoaHostingController not working #386

beachcitiessoftware opened this issue Aug 15, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@beachcitiessoftware
Copy link

beachcitiessoftware commented Aug 15, 2022

In SceneDelegate:

window.rootViewController = CocoaHostingController(mainView: contentView)

In first view:

@Environment(\.presenter) var presenter
...    
.onAppear {
  if let presenter = presenter {
      presenter.present(EmptyView())
  }
...

presenter is always nil.

What am I missing? This should work according to the Wiki? https://github.com/SwiftUIX/SwiftUIX/wiki/Dynamic-Presentation

@vmanot vmanot self-assigned this Aug 17, 2022
@vmanot vmanot added the bug Something isn't working label Aug 17, 2022
@vmanot
Copy link
Member

vmanot commented Aug 17, 2022

@beachcitiessoftware this is odd, I'll take a look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants