     }
     
     private func animate() {
+        guard let view = view else { return }
+        
         view.backgroundColor = toBackgroundColor
         view.tableView.frame.origin.x = toX
         view.searchTextField.frame.origin.x = toX

    }
    
    func presentationPreAnimation(transition: DrawerMenuTransition) {
        view.setNeedsLayout()
        view.layoutIfNeeded()
        


class ContactListTransitionAnimator: DrawerMenuTransitionDelegate {
    
    weak var view: ContactListView?
    
    private(set) var toX: CGFloat!
    private(set) var toBackgroundColor: UIColor!
    
    func dismissalPreAnimation(transition: DrawerMenuTransition) {
        guard let view = view else { return }
        
        toX = -max(view.tableView.frame.width, view.searchTextField.frame.width)
        toBackgroundColor = toBackgroundColor.withAlphaComponent(0.0)
    }
