In order to fulfill the promise of MVC I have a question regarding creating structs or not. Right now, an array of customs UIViews are passed to a ViewController which arranges them.
The custom UIView looks for example like this
class TopView: UIView {
private var text: String
private var question: String
private var explanation: String
required init(text: string,...) {
self.text = text
...
}
....
}
Then those UIViews are passed as an array to a View Controller and a function inside will arranges them. Therefore, lots of arrays of UIViews are stored like this
let derivative: [UIView] = [TopView(text: "", ....),
MainBodyView(text:"",...),
BottomView(text:"",...)
]
So, to have a clear and good code structure I want to know if it better to create structs containing all these information and a function inside the ViewController which extracts the information and put them into views. Or are there better ways to do it ?