         let reference = backgroundView.frame
         
         var up = true;
-        switch resolveButtonPosition(for: view.window!.bounds.size.orientation) {
+        switch resolveButtonPosition(for: _lastLayoutContainerOrientation) {
         case .rightLeft:
             up = location.x > (reference.size.width / 2)
         case .leftRight:

    @IBOutlet private weak var lifeTotalLabel: UILabel!
    @IBOutlet private weak var plusButton: UIButton!
    @IBOutlet private weak var minusButton: UIButton!
    
    @IBAction private func plusButtonPressed(_ sender: AnyObject) {
        lifeTotal += 1

    }
    
    override func viewDidLayoutSubviews() {
        _lastLayoutContainerOrientation = view.bounds.size.orientation
        setConstraints(for: _lastLayoutContainerOrientation)
        super.viewDidLayoutSubviews()
    }
    
