I believe this is something simple to do but I don't have knowledge of it, I'm still a noobie (I'm searching for days, still didn't able to find an answer or similar problem, finally I decided to ask)
Thing is I have classes named (basically databases) : QuestionBank001, QuestionBank002 .. etc
So when I pick a questionbank and go to another viewcontroller, I want to able to create a specific instance. But I have to create this variable just under UIViewController, because there are functions requires it :
class test1: UIViewController {
var questions = QuestionBank001()
So my problem is, I don't know how to add an if / switch statement (or a get/set?) correctly. Or how to initiate it. If I able to create an empty variable (without type) I would use viewDidLoad() section and make a switch statement there but I don't know how to do that.
Aucun commentaire:
Enregistrer un commentaire