     
     private var currentOrientation: UIDeviceOrientation = .unknown
     
+    #if swift(>=3.2)
+    private var observeContext: NSKeyValueObservation?
+    #else
+    private var isObserveKVO: Bool = false
+    private static var observeContext: Int = 0
+    #endif
+
     /// Gesture
     private var gestureBeginPoint: CGPoint = CGPoint.zero
     private var gestureMovePoint: CGPoint = CGPoint.zero

        updateLayout()
    }
    
    open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
        super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
        
        if keyPath == "center" {
            updateLayout()
        }
    }
    
    public required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

        }
        
        /// Events
        #if swift(>=3.2)
            observeContext = view.observe(\.frame) { [weak self] (view, event) in
                self?.updateLayout()
            }
        #else
            view.addObserver(self, forKeyPath: "frame", options: .new, context: &DrawerController.observeContext)
            isObserveKVO = true
        #endif
    }
    
    deinit {
        #if swift(>=3.2)
            observeContext?.invalidate()
            observeContext = nil
        #else
            if isObserveKVO {
                view.removeObserver(self, forKeyPath:"frame")
            }
        #endif
    }
    
    open override func viewDidLayoutSubviews() {
