joshdholtz / DeckUI

Swift DSL for writing slide decks in Xcode
MIT License
601 stars 27 forks source link

Using camera leads to fatal error NSViewRepresentables must be value types #30

Closed anttijuu closed 1 year ago

anttijuu commented 1 year ago

Hi all.

I am on a Mac mini M1, macOS Ventura 13.2, Xcode Version 14.1 (14B47b), fresh DeckUI package from GitHub added as a package to macOS app project. App deployment target is set to macOS 13.0.

Trying to enable presenter camera:

struct ContentView: View {
   var body: some View {
      Presenter(deck: self.deck, defaultResolution: Presenter.DefaultResolution(width: 2000, height: 1200), showCamera: true)
    }
}

App builds good, but crashes with error immediately:

SwiftUI/NSViewRepresentable.swift:243: Fatal error: NSViewRepresentables must be value types: PlayerContainerView

My App is sandboxed, has Camera and User selected files permissions, signed to run locally. Info.plist contains camera usage description (privacy). Have given permission to use camera when app launches (showCamera set to false).

App works wonderfully when setting showCamera: false.

Anything I am doing wrong?

anttijuu commented 1 year ago

I added the DeckUI package again, now specifying that it would use main branch (newest version) instead of version up to something something which is the default I guess.

Now the camera works. So closing the issue.