<NME> ViewNode.swift
<BEF> //
//  OpaqueView.swift
//  TemplateKit
//
//  Created by Matias Cudich on 9/8/16.
//  Copyright © 2016 Matias Cudich. All rights reserved.
//

import Foundation
import CSSLayout

class ViewNode: PropertyNode {
  weak var owner: Node?
  weak var parent: Node?
  var context: Context?

  var properties: DefaultProperties
  var children: [Node]?
  var element: ElementData<DefaultProperties>
  var cssNode: CSSNode?

  }
  var element: ElementData<DefaultProperties>
  var cssNode: CSSNode?
  var builtView: View?

  required init(element: Element, children: [Node]?, owner: Node?) {
    self.element = element as! ElementData<DefaultProperties>
    self.context = context
  }

  func build() -> View {
    updateParent()
  }

  init(view: UIView, element: Element, owner: Node? = nil, context: Context? = nil) {
    self.builtView = view
    self.element = element as! ElementData<DefaultProperties>
    self.properties = self.element.properties

<MSG> Merge pull request #139 from mcudich/cleanup

Make ViewNode generic on its view type
<DFF> @@ -9,7 +9,7 @@
 import Foundation
 import CSSLayout
 
-class ViewNode: PropertyNode {
+class ViewNode<ViewType: View>: PropertyNode {
   weak var owner: Node?
   weak var parent: Node?
   var context: Context?
@@ -22,7 +22,7 @@ class ViewNode: PropertyNode {
   }
   var element: ElementData<DefaultProperties>
   var cssNode: CSSNode?
-  var builtView: View?
+  var builtView: ViewType?
 
   required init(element: Element, children: [Node]?, owner: Node?) {
     self.element = element as! ElementData<DefaultProperties>
@@ -33,7 +33,7 @@ class ViewNode: PropertyNode {
     updateParent()
   }
 
-  init(view: UIView, element: Element, owner: Node? = nil, context: Context? = nil) {
+  init(view: ViewType, element: Element, owner: Node? = nil, context: Context? = nil) {
     self.builtView = view
     self.element = element as! ElementData<DefaultProperties>
     self.properties = self.element.properties

Merge pull request #139 from mcudich/cleanup