This is my first app I am developing for my daughter studies who is in kindergarten and also my first question in stack overflow. Please excuse me if any format issues or if any irrelevance to the forum.
Requirements:
- I want a home page (home view) with drop down (or popuplist) with values like a. Addition b. Subtraction c. spellings etc.
and "start test" button on bottom
- Based on the drop down list options, I want to display the questions (around 10 questions per category) - "Test view"
It consists of 3 parts a. example (how to answer the question) b. question c. answer area (it can be text field(s) or radio button(s) based on question category in home page.
- Results view - After 10 questions are completed, it takes to results screens saying "congrats! your test is completed" (something like this). From there
This is what I have done so far
- First of all, I decided to use swift3 to create ios app and I created few png files (for questions) and kept them in assets folder for my use.
- I created 3 views and 3 view controllers (home view, test view and results view)
- each view has its own separate viewcontroller.swift files assigned
- I stored questions in 3 folders (additions, subtraction etc with 1.png, 2.png, 3.png etc)
- able to test the app for addition successfully as I placed sample images for additions on my "test" view. For additions, I am able to save questions in questions array and answers in answers array and able to complete the test for 10 questions and able to go to results page and display results. But I am stuck when extending this solution for more question categories like subtractions, spellings etc.
Now my question is
If I want to handle subtraction and spelling, should I create another view for subtraction and another view for spelling? or is there any dynamic way to load the "test" view based on user drop down choice in home page ?
Is there any properties file kind of concept in swift, where I can store the kind of values in drop down list and based on that "test" view will be loaded dynamically with sample questions and answer area (Note: answer area can be input text field or radio button based on question category)
My current idea is to keep adding new view and new view controller when new category of questions are added but I felt this approach is not simple and robust as I need to add/modify the code every single time I add new category. I am trying to find a simple and robust way to handle this use case.
Any ideas would be greatly appreciated.