I’ve done quite a bit of searching and can’t seem to find a good answer to the following question:
I’m trying to make a quiz application. I want to have 5 areas of text on the UIView: (1) the question, (2)(3)(4)(5) are options. When the user clicks an option, (2)(3)(4)(5), the next question should immediately populate all 5 areas. The question and options are of variable length, usually 3 lines of text. There needs to be a way to have an identifier with the selection so the code can evaluate the quiz.
Should I be doing this using UIButton? UITextView and somehow make the text a button? Some combination of the two?
@bhuff1 Interesting question. May I suggest a UITableView? Many of the moving parts are already built in, and would very easily function as you described.
Each row could represent an answer, and with the user selecting an option, the UITableView’s delegate method, “didSelectRowAtIndexPath” would be triggered, which could then call the UITableView’s reloadData method, thus, refreshing the UITableView, and presenting the next question to the user. You wouldn’t need to implement any UIButton’s with this solution, and behind the scene’s, you’d keep score. What do you think?
That doesn’t quite work because the background is going to have customized artwork that I want the user to see.
Thanks for your quick reply, though!
@bhuff1 You can use customized artwork as the background for a UITableView