         }
     }
 }
+
+extension Array where Iterator.Element == UIElement {
+    func generatedNames(tempCounter: inout Int) -> [String] {
+        var names = [] as [String]
+        for child in self {
+            defer {
+                if let container = child as? UIContainer {
+                    names.append(contentsOf: container.children.generatedNames(tempCounter: &tempCounter))
+                }
+            }
+
+            let name: String
+            if child.field != nil {
+                continue
+            } else if let layoutId = child.layout.id {
+                name = "named_\(layoutId)"
+            } else {
+                name = "temp_\(type(of: child))_\(tempCounter)"
+                tempCounter += 1
+            }
+
+            names.append(name)
+        }
+
+        return names
+    }
+}

                l()
                l("private weak var target: \(root.type)?")
                l()
                func generateChildProperties(children: [UIElement]) {

                    for child in children {
                        defer {
                            if let container = child as? UIContainer {
                                generateChildProperties(children: container.children)
                            }
                        }

                        let name: String
                        if child.field != nil {
                            continue
                        } else if let layoutId = child.layout.id {
                            name = "named_\(layoutId)"
                        } else {
                            name = "temp_\(type(of: child))_\(tempCounter)"
                            tempCounter += 1
                        }
                        l("private weak var \(name): UIView?")
                    }
                }
                generateChildProperties(children: root.children)
                tempCounter = 1
                l()
                l("fileprivate init(target: \(root.type))") {

                l()
                l("func updateReactantUI()") {
                    tempCounter = 1
                    let guardNames = ["target"] + root.children.generatedNames(tempCounter: &tempCounter)
                    if !guardNames.isEmpty {
                        l("guard ")
                        for guardName in guardNames {
