kaorimatz/KZSideDrawerController

Problems with horizontal orientation

Opened this issue · 1 comments

Hi! Great library! I've found a bug, though: if you present the configured KZSideDrawerController when the phone is in horizontal orientation, the leftViewController gets cut off when you rotate the phone back to vertical orientation and show the left view again.

Steps to reproduce:

  1. Rotate your device to landscape orientation.
  2. Present KZSideDrawerController, configured with center and left view controllers.
  3. Rotate the device to portrait orientation.
  4. Present left view controller.

Result:
Left view controller won't stretch from top to bottom but will "remember" height from landscape mode.

Should be:
Left view controller should stretch from top to bottom of the KZSideDrawerController.

Tried solutions:

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
        // centerView -- setting this WORKS
        var centerFrame = self.centerViewController!.view.frame
        centerFrame.size = size
        self.centerViewController!.view.frame = centerFrame
        // leftView -- setting this DOESN'T WORK
        var leftFrame = self.leftViewController!.view.frame
        leftFrame.size.width = min(size.width, size.height)
        leftFrame.size.height = max(size.width, size.height)
        self.leftViewController!.view.frame = leftFrame
    }

Do you have any idea how to fix this?

Hi, thanks for having interest in this library and reporting this issue.
Unfortunately so far I could not reproduce the issue. Could you please provide a minimal example code reproducing this issue?