Keeping strong references with dynamic subviews in Swift
问题 I'm trying to implement a dynamic view composed UI elements sent by the backend, meaning it is not known beforehand how many and which UI elements will be displayed, the server sends JSON containing the types of fields that need to be rendered. So for example the sever sends: type: paragraph type: textfield Then I instantiate a class I have for each of those elements and add their views as subviews to my main dynamic view: class DynamicViewController: UIViewController { // array of subviews,