I am new to mobile development, and I am building an iOS application with Swift that involves a process where a user answers a series of questions in the form of multiple view controllers in a navigation controller stack.
Basically, I need to capture the text from all the buttons that the user clicks on in his process from controller A to controller D. (One button click leads to the next view controller) By the time, the user reaches controller D, I want to have a array of data that represents what he pressed from controllers A to C.
On controller D, I ask the user if they would like to repeat the process. For example, I would ask the user about a car they own, and, if they own another car, D would take them back to controller A and repeat the process again where the new responses would be saved as another array.
After the user has no more cars, the program moves on to the next section where I would need to load these arrays from before and display different view controllers based on what they entered.
What would be the best way to handle this? I have considered using SQlite to temporarily save the data, but other people have told me to use NSUserDefaults since it takes less time. I will NOT need persistence for this application since I want the user to restart the process from the beginning after they quit the application.
Aucun commentaire:
Enregistrer un commentaire