Search code examples
arraysswiftview

How can I make my app present quote from an array and then proceed in order through the remaining quotes?


Part of my app is to provide the user with a random quote about sustainability. I have an array of quotes, but haven't thought about how to present it to the user yet so that they are presented with a quote and then can click the next button to see the next one. The app should also make it so that they can pick up where they left off. For example, if they got to quote 10/80 then the next time they go go the quote section they start on quote 10. I also want users to be able to save each quote. Is an array the best way to do this? Would it be completely wrong to use a new view controller for each quote? I'm very new to all this so any help would be great.


Solution

  • As an update, I so far found the best way to do this in my case was to use a collection view. As you scroll through each cell in the collection view you see a new quote. You also see a unique save button for each quote that can hide when tapped, which also then unhides the "unlike" button.