joshdholtz / DeckUI

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

Index binding #34

Closed mortenbekditlevsen closed 1 year ago

mortenbekditlevsen commented 1 year ago

This is a feature that I would like to use myself: Being able to control the slide index from the outside.

I don't think the implementation is particularly nice. If you think the functionality is ok, I'd suggest a refactor to some kind of ViewModel holding on to number of slides and the index. By default the view could create it's own vm, but if you're interested in more control, then you can pass along your own.

Let me know what you think.

Please squash if ever this is merged - I committed a bit too much initially and had to clean up... :-)

mortenbekditlevsen commented 1 year ago

I'll close this - as controlling the slide index from the outside (if you agree that this should be possible) would be better handled through the PresentationState from the presenter notes PR.