IOS set UIViewController.view.frame = CGCGRect(x: -200..) can not click button
<p>I want put several UIViewController together:</p>

<pre><code>leftViewController.view.frame = CGRect(x: -200, y: 0.0, width: size.width/drawerSize, height: size.height)

    // Center Drawer
    centerViewController.view.frame = CGRect(x: leftViewController.view.frame.width, y: 0.0, width: centerWidth, height: size.height)

    // Right Drawer
    rightViewController.view.frame = CGRect(x: centerViewController.view.frame.origin.x + centerViewController.view.frame.size.width, y: 0.0, width: size.width/drawerSize, height: size.height)
</code></pre>

<p>In the <strong>first line</strong> I use </p>

<pre><code>leftViewController.view.frame = CGRect(x: -200, y....)
</code></pre>

<p>They will show correctly but I can not click buttons on leftViewController.</p>

<p>If </p>

<pre><code>leftViewController.view.frame = CGRect(x: 0.0, y...)
</code></pre>

<p>then could click button but this layout is not I want.</p>

<p>The full code is posted by @Kevin Scardina <a href="https://stackoverflow.com/questions/24123004/slide-sidebar-menu-ios-8-swift">Slide Sidebar Menu IOS 8 Swift</a></p>

<p>It now function as the picture below, And I'm trying to modify it like a slide menu bar which could hid left and right menu.</p>

<pre><code>/*
  To use simply instantiate NVMDrawerController as your root view in your AppDelegate, or in the 
   StoryBoard.
  Once NVMDrawerController is instantiated, set the drawerSize of the NVMDrawerController, 
 and its leftViewControllerIdentifier, centerViewControllerIdentifier, and 
   rightViewControllerIdentifier to the Storyboard Identifier of the UIViewController 
  you want in the different locations.
*/
class NVMDrawerController: UIViewController {

// This is where you set the drawer size (i.e. for 1/3rd use 3.0, for 1/5 use 5.0)
var drawerSize:CGFloat = 4.0
var leftViewControllerIdentifier:String = "LeftController"
var centerViewControllerIdentifier:String = "CenterController"
var rightViewControllerIdentifier:String = "RightController"

private var _leftViewController:UIViewController?
var leftViewController:UIViewController {
    get{
        if let vc = _leftViewController {
            return vc;
        }
        return UIViewController();
    }
}
private var _centerViewController:UIViewController?
var centerViewController:UIViewController {
    get{
        if let vc = _centerViewController {
            return vc;
        }
        return UIViewController();
    }
}
private var _rightViewController:UIViewController?
var rightViewController:UIViewController {
    get{
        if let vc = _rightViewController {
            return vc;
        }
        return UIViewController();
    }
}

static let NVMDrawerOpenLeft = 0
static let NVMDrawerOpenRight = 1
var openSide:Int {
    get{
        return _openSide;
    }
}
private var _openSide:Int = NVMDrawerOpenLeft

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.

    // Instantiate VC's with storyboard ID's
    _leftViewController = instantiateViewControllers(leftViewControllerIdentifier)
    _centerViewController = instantiateViewControllers(centerViewControllerIdentifier)
    _rightViewController = instantiateViewControllers(rightViewControllerIdentifier)

    // Call configDrawers() and pass the drawerSize variable.
    drawDrawers(UIScreen.mainScreen().bounds.size)

    self.view.addSubview(leftViewController.view)
    self.view.addSubview(centerViewController.view)
    self.view.addSubview(rightViewController.view)

}

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
    coordinator.animateAlongsideTransition({ (UIViewControllerTransitionCoordinatorContext) -&gt; Void in
        // This is for beginning of transition
            self.drawDrawers(size)
        }, completion: { (UIViewControllerTransitionCoordinatorContext) -&gt; Void in
            // This is for after transition has completed.
        })

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

// MARK: - Drawing View

func drawDrawers(size:CGSize) {
    // Calculate Center View's Size
    let centerWidth = (size.width/drawerSize) * (drawerSize - 1)

    // Left Drawer
    leftViewController.view.frame = CGRect(x: 0.0, y: 0.0, width: size.width/drawerSize, height: size.height)

    // Center Drawer
    centerViewController.view.frame = CGRect(x: leftViewController.view.frame.width, y: 0.0, width: centerWidth, height: size.height)

    // Right Drawer
    rightViewController.view.frame = CGRect(x: centerViewController.view.frame.origin.x + centerViewController.view.frame.size.width, y: 0.0, width: size.width/drawerSize, height: size.height)
    //rightViewController = rc

    // Capture the Swipes
    let swipeRight = UISwipeGestureRecognizer(target: self, action: Selector("swipeRightAction:"))
    swipeRight.direction = .Right
    centerViewController.view.addGestureRecognizer(swipeRight)

    let swipeLeft = UISwipeGestureRecognizer(target: self, action: Selector("swipeLeftAction:"))
    swipeLeft.direction = .Left
    centerViewController.view.addGestureRecognizer(swipeLeft)

    if(openSide == NVMDrawerController.NVMDrawerOpenLeft){
        openLeftDrawer()
    }
    else{
        openRightDrawer()
    }
}

// MARK: - Open Drawers

func openLeftDrawer() {
    _openSide = NVMDrawerController.NVMDrawerOpenLeft
    UIView.animateWithDuration(0.1, delay: 0, options: UIViewAnimationOptions.CurveEaseIn, animations:
        { () -&gt; Void in
            // move views here
            self.view.frame = CGRect(x: 0.0, y: 0.0, width: self.view.bounds.width, height: self.view.bounds.height)
        }, completion:
        { finished in
    })
}

func openRightDrawer() {
    _openSide = NVMDrawerController.NVMDrawerOpenRight
    UIView.animateWithDuration(0.1, delay: 0, options: UIViewAnimationOptions.CurveEaseIn, animations:
        { () -&gt; Void in
            // move views here
            self.view.frame = CGRect(x: self.view.bounds.origin.x - self.leftViewController.view.bounds.size.width, y: 0.0, width: self.view.bounds.width, height: self.view.bounds.height)
        }, completion:
        { finished in
    })
}

// MARK: - Swipe Handling

func swipeRightAction(rec: UISwipeGestureRecognizer){
    self.openLeftDrawer()
}

func swipeLeftAction(rec:UISwipeGestureRecognizer){
    self.openRightDrawer()
}

// MARK: - Helpers

func instantiateViewControllers(storyboardID: String) -&gt; UIViewController {
    if let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("\(storyboardID)") as? UIViewController{
        return viewController;
    }

    return UIViewController();
}
</code></pre>

<p>}</p>

<p><a href="https://i.stack.imgur.com/9CH5I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9CH5I.png" alt="enter image description here"></a></p>