         dragLine.path = path
         return dragLine
     }
+    
+    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
+        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
+        coordinator.animateAlongsideTransition(nil, completion: { context in
+            self.updateScrollableSize()
+        })
+    }
+    
+    func updateScrollableSize() {
+        var maxY: CGFloat = 0
+        var maxX: CGFloat = self.view.bounds.width
+        for view in connectorLabels {
+            maxY = max(maxY, CGRectGetMaxY(view.frame))
+            maxX = max(maxX, CGRectGetMaxX(view.frame))
+        }
+        for view in constraintViews {
+            maxY = max(maxY, CGRectGetMaxY(view.frame))
+            maxX = max(maxX, CGRectGetMaxX(view.frame))
+        }
+        
+        self.scrollView.contentSize = CGSizeMake(maxX, maxY + self.view.bounds.height)
+    }
 }
 

                    }
                }
                rebuildAllConnectionLayers()
                self.currentDrag = nil
            }
        case .Possible:

            }
            index += 1
        }
        
        
    }
    
    func createConnectionLayer(startPoint: CGPoint, endPoint: CGPoint, color: UIColor?) -> CAShapeLayer {
