             
         }
         
-        if UIDeviceOrientationIsLandscape(UIDevice.currentDevice().orientation) {
+        if UIDeviceOrientationIsLandscape(orientation) {
             
             limitView.frame = CGRectMake(0, topHeight, height, 50)
             limitViewLabel.frame = CGRectMake(0, 0, height, 50)

        // Dispose of any resources that can be recreated.
    }
    
    func rotated() {
        
        let statusHeight = UIApplication.sharedApplication().statusBarFrame.height
        let navHeight = self.navigationController?.navigationBar.frame.size.height

        var toLeftPickerView = UIPickerView()
        var toRightPickerView = UIPickerView()
        
        if orientation == UIDeviceOrientation.Portrait {
            
            limitView.frame = CGRectMake(0, topHeight, width, 50)
            limitViewLabel.frame = CGRectMake(0, 0, width, 50)
