     leftButton = createLeftButton()
     rightButton = createRightButton()
     
-    layout(UIDevice.currentDevice().orientation)
+    layout(UIDevice.currentDevice().orientation, animation: .BeforeAnimation)
     
     addSubview(leftButton)
     addSubview(rightButton)

    case LowerRightCorner
  }
  
  let screenHeight = CGRectGetHeight(UIScreen.mainScreen().bounds)
  let screenWidth = CGRectGetWidth(UIScreen.mainScreen().bounds)
  let kButtonSize = CGSize(width: 60, height: 60)

      leftButton.frame = position(leftButton, atCorner: .UpperRightCorner)
      rightButton.frame = position(rightButton, atCorner: .LowerRightCorner)
    }
    
    switch orientation {
    case .Portrait:
      leftButton.frame.origin.y += kButtonOffset
      rightButton.frame.origin.y += kButtonOffset
    case .PortraitUpsideDown:
      leftButton.frame.origin.y -= kButtonOffset
      rightButton.frame.origin.y -= kButtonOffset
    case .LandscapeLeft:
      leftButton.frame.origin.x -= kButtonOffset
      rightButton.frame.origin.x -= kButtonOffset
    default:
      leftButton.frame.origin.x += kButtonOffset
      rightButton.frame.origin.x += kButtonOffset
    }
    
    if animation == .BeforeAnimation {
      switch orientation {
      case .Portrait:
        leftButton.frame.origin.x -= CGRectGetWidth(leftButton.frame)
        rightButton.frame.origin.x += CGRectGetWidth(rightButton.frame)
      case .PortraitUpsideDown:
        leftButton.frame.origin.x += CGRectGetWidth(leftButton.frame)
        rightButton.frame.origin.x -= CGRectGetWidth(rightButton.frame)
      case .LandscapeLeft:
        leftButton.frame.origin.y -= CGRectGetHeight(leftButton.frame)
        rightButton.frame.origin.y += CGRectGetHeight(rightButton.frame)
      default:
        leftButton.frame.origin.y += CGRectGetHeight(leftButton.frame)
        rightButton.frame.origin.y -= CGRectGetHeight(rightButton.frame)
      }
    }
  }
  
  // функция возвращает frame элемента, который был передан с измененным положением на
