     override func viewDidLoad() {
         super.viewDidLoad()
         self.scrollView = UIScrollView(frame: self.view.bounds)
+        self.scrollView.autoresizingMask = .FlexibleWidth | .FlexibleHeight
         self.scrollView.panGestureRecognizer.minimumNumberOfTouches = 2
         self.view.insertSubview(self.scrollView, atIndex: 0)
         

        }
        connectorToLabel[label.connector] = label
        self.scrollView.addSubview(label)
    }
    func moveConnectorToTopPriority(connectorLabel: ConnectorLabel) {
        if let index = find(connectorLabels, connectorLabel) {

        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)
    }
}

