Replies: 1 comment
-
I did a simple implementation of how I could see using the package (almost) as is to present different decks in a fork. Take a look at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently building an app to create a script for a curriculum to teach a class. I want to include slides in the script in a way so that I can export the script itself including the slides, but also present the slides. The slides can be constructed by parsing the user's input into a
Deck
.For presenting the slides, I found this repo and gave it a shot. It's a great package that serves the purpose of creating just one presentation in a DSL manner to present very well. It's also very inspiring, so thanks for sharing it in the first place!
I found out that for my specific use case, the structure of the package should be different though. Presenting a specific deck does not seem possible as it is right now.
I went down the rabbit hole of looking into the
Scene
API and found out that there is a way to present a specific scene by handing it a specific deck a the callsite.Consider the following code:
Opening such a scene at the callsite looks like this:
That would enable us to inject a deck when opening the presenter scene window.
The only problem with this is:
Deck
needs to beHashable
&Codable
for that to work. Problem with that is that there are SwitUI types in use that simply are notCodable
(I found a workaround to makeColor
codable, but I failed to find anything useful forFont
...)–I most likely have not found all of them yet...That is, if we were to inject a
Deck
. One workaround could be to have a store of decks that we can refer to and just inject theUUID
of the deck (which would requireDeck
to conform toCadable
). It would be thePresentationContentView
's job to then fetch the deck from the store.If I can find the time, I will look into this–but perhaps this serves as an inspiration for someone else...
I looked a bit further into this and I think there is a fighting chance to be able have more than one Deck in a project.
Consider the following code:
Opening such a scene at the callsite looks like this:
That would enable us to inject a deck when opening the presenter scene window.
https://developer.apple.com/documentation/swiftui/windowgroup
The only problem with this is:
Deck
needs to beHashable
&Codable
for that to work. Problem with that is that there are SwitUI types in use that simply are notCodable
(I found a workaround to makeColor
codable, but I failed to find anything useful forFont
...)–I most likely have not found all of the problematic types yet...That is, if we were to inject a
Deck
. One workaround could be to have a store of decks that we can refer to and just inject theUUID
of the deck inopenWindow
. It would be thePresentationContentView
's job (in this case) to then fetch the deck from the store.If I can find the time, I will look into this–but perhaps this serves as an inspiration for someone else...
Beta Was this translation helpful? Give feedback.
All reactions