 import UIKit
 
 class GridView: UIView {
+  override func drawRect(rect: CGRect) {
+    let wt = rect.size.width; let ht = rect.size.height
+    
+    let ctx = UIGraphicsGetCurrentContext()
+    CGContextSetFillColorWithColor(ctx, UIColor.blackColor().CGColor)
+    CGContextFillRect(ctx, rect)
+    
+    CGContextSetLineWidth(ctx, 1.0)
+    for step in 0...Int(ceil(ht / 10.0)) {
+      CGContextMoveToPoint(ctx, 0.0, CGFloat(step) * 10.0) // horizontal
+      CGContextAddLineToPoint(ctx, wt, CGFloat(step) * 10.0)
+    }
+    
+    for step in 0...Int(ceil(wt / 10.0)) {
+      CGContextMoveToPoint(ctx, CGFloat(step) * 10.0, 0.0) // vertical
+      CGContextAddLineToPoint(ctx, CGFloat(step) * 10.0, ht)
+    }
+    
+    CGContextSetStrokeColorWithColor(ctx, ColorSwatch.sr_darkTeal.CGColor)
+    CGContextDrawPath(ctx, CGPathDrawingMode.Stroke)
+  }
+}
+
+class AskewGridView: UIView {
   
   override func drawRect(rect: CGRect) {
     let xt = rect.origin.x; let yt = rect.origin.y

    
    self.gridView.snp_makeConstraints { (make) -> Void in
      make.top.left.right.equalTo(self.view)
      make.height.equalTo(220.0)
    }
    
    self.bottomView.snp_makeConstraints { (make) -> Void in

    // Dispose of any resources that can be recreated.
  }
  
  
  internal func addTapGestureToView() {
    let gesture: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "tappedView:")
    self.simulationView.addGestureRecognizer(gesture)
  }
  
  internal func tappedView(sender: AnyObject?) {
    var t = CATransform3DIdentity
//    t.m14 = -0.1
//    t.m24 = -0.1
//    t.m34 = -1.0
//    t.m41 = 100.0
//    t.m42 = 50.0
//    t.m43 = -1.0
    
//    t.m13 = 1.0
    t.m23 = -1.0
    t.m33 = -0.5
    
    
    self.simulationView.layer.anchorPoint = CGPointMake(0.0, 0.0)
//    self.simulationView.layer.anchorPointZ = -150.0
    self.simulationView.layer.position = CGPointMake(CGRectGetMinX(self.simulationView.frame) - CGRectGetMidX(self.simulationView.bounds),CGRectGetMinY(self.simulationView.frame) - CGRectGetMidY(self.simulationView.bounds))
    
    
    UIView.animateWithDuration(5.0, delay: 0.0, options: [.Repeat], animations: { () -> Void in
      self.simulationView.layer.transform = t
//      self.simulationView.layer.anchorPointZ = -200.0
      }) { (complete: Bool) -> Void in
        //        self.simulationView.layer.transform = CATransform3DIdentity
//        self.simulationView.layer.anchorPoint = CGPointMake(0.5, 0.5)
    }

  }
  
  internal func configureConstraints() {
    self.simulationView.snp_makeConstraints { (make) -> Void in
