     private var containerView: UIView!
     private var focusIndicatorView: UIView!
     private var flashButton: UIButton!
-    private var widgetOrientation : UIInterfaceOrientation = .Portrait
-//    private var deviceOrientation : UIDeviceOrientation = UIDevice.currentDevice().orientation {
-//        didSet {
-//            switch deviceOrientation {
-//            case .FaceDown, .FaceUp, .Unknown:
-//                ()
-//            case .LandscapeLeft:
-//                widgetOrientation = .LandscapeLeft
-//            case .LandscapeRight:
-//                widgetOrientation = .LandscapeRight
-//            case .Portrait:
-//                widgetOrientation = .Portrait
-//            case .PortraitUpsideDown:
-//                widgetOrientation = .PortraitUpsideDown
-//            }
-//            updateWidgetsToOrientation(widgetOrientation)
-//        }
-//    }
+//    private var widgetOrientation : UIInterfaceOrientation = .Portrait
     private var pickerButton : UIButton!
     private var closeButton : UIButton!
     private let buttonMargin : CGFloat = 12

        } else {
            cell = collectionView.dequeueReusableCellWithReuseIdentifier(PhotoCollectionViewCell.cellIdentifier(), forIndexPath: indexPath) as! PhotoCollectionViewCell
        }

        if widgetOrientation == .LandscapeLeft {
            cell.contentView.transform = CGAffineTransformMakeRotation(CGFloat(M_PI/2))
        } else if widgetOrientation == .LandscapeRight {
            cell.contentView.transform = CGAffineTransformMakeRotation(CGFloat(-M_PI/2))
        } else {
            cell.contentView.transform = CGAffineTransformMakeRotation(0)
        }

        cell.delegate = self
        return cell
    }

        flashButton.layer.anchorPoint = CGPointMake(0.5, 0.5)
        pickerButton.layer.anchorPoint = CGPointMake(0.5, 0.5)

        var flashPosition = flashButton.frame.origin
        var pickerPosition = pickerButton.frame.origin
        if orientation == .LandscapeLeft || orientation == .LandscapeRight {
            flashPosition = CGPointMake(buttonMargin - (buttonMargin/3), buttonMargin)
            pickerPosition = CGPointMake(view.bounds.width - (pickerButton.bounds.size.width/2 - buttonMargin), buttonMargin)
        } else if orientation == .Portrait || orientation == .PortraitUpsideDown {
            pickerPosition = CGPointMake(view.bounds.width - (pickerButton.bounds.size.width + buttonMargin), buttonMargin)
            flashPosition = CGPointMake(buttonMargin, buttonMargin)
        }
        let animations = {
            self.pickerButton.rotateToDeviceOrientation()
            self.pickerButton.frame.origin = pickerPosition
            self.flashButton.rotateToDeviceOrientation()
            self.flashButton.frame.origin = flashPosition
            self.closeButton.rotateToDeviceOrientation()

            for cell in self.collectionView.visibleCells() {
                cell.contentView.rotateToDeviceOrientation()
            }
        }
        UIView.animateWithDuration(0.25, animations: animations)
