         imageView = UIImageView(image: image)
         let rotatedView = RotatedView(frame: imageView.frame)
         rotatedView.tag = 1
+        rotatedView.layer.anchorPoint = CGPoint.init(x: 0.5, y: 0)
+        rotatedView.layer.transform = rotatedView.transform3d()
         
         rotatedView.addSubview(imageView)
         animationView?.addSubview(rotatedView)

        }
        
        containerView.alpha = 0;
    }
    
    // MARK: public
    
    public func selectedAnimation(isSelected: Bool, animated: Bool, completion: CompletionHandler?) {

        if isSelected {
            containerView.alpha = 1;
            for subview in containerView.subviews {
                subview.alpha = 1
            }

            if animated {
                openAnimation(completion: completion)
            } else {
                foregroundView.alpha = 0
                for subview in containerView.subviews {
                    if subview is RotatedView {
                        let rotateView = subview as! RotatedView
                        rotateView.backView?.alpha = 0
                    }
                }
            }
        } else {
            if animated {
                closeAnimation(completion: completion)

    
    func configureAnimationItems(animationType: AnimationType) {
        if animationType == .Open {
            for view in animationView!.subviews.filter({$0 is RotatedView}) {
                view.alpha = 0;
            }
        } else { // close
            for view: RotatedView in animationView!.subviews.filter({$0 is RotatedView}) as! [RotatedView] {
                if animationType == .Open {
                    view.alpha = 0
                } else {
