             UIView.animate(
                 withDuration: duration,
                 animations: {
-                    self.mediaPickerView.transform = CGAffineTransform(interfaceOrientation: toInterfaceOrientation);
-                    self.mediaPickerView.frame = self.view.bounds;
+                    self.layoutMediaPickerView(interfaceOrientation: toInterfaceOrientation)
             })
         }
         super.willAnimateRotation(to: toInterfaceOrientation, duration: duration)

    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        navigationController?.setNavigationBarHidden(true, animated: animated)
        UIApplication.shared.setStatusBarHidden(true, with: .fade)

        mediaPickerView.setShowsCropButton(showsCropButton)
    }
    
    // MARK: - Private
    
    func layoutMediaPickerView(interfaceOrientation: UIInterfaceOrientation) {
        mediaPickerView.frame = view.bounds
        mediaPickerView.transform = CGAffineTransform(interfaceOrientation: interfaceOrientation)
    }
    
    // MARK: - Dispose bag
    
    private var disposables = [AnyObject]()
