         }
         toView.isHidden = true
         
+        let appIconContainerView = UIView(frame: appIconFrame)
+        containerView.addSubview(appIconContainerView)
+        
         let appIconImageView = UIImageView(image: appInfo.image)
-        containerView.addSubview(appIconImageView)
-        appIconImageView.frame = appIconFrame
+        appIconContainerView.addSubview(appIconImageView)
+        // TODO: why don't these autolayout constraints work?
+        appIconImageView.frame = appIconContainerView.bounds
+        appIconImageView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
         
-        
-        
-        appInitialViewSnapshot.layer.masksToBounds = true
-        appIconImageView.addSubview(appInitialViewSnapshot)
         // TODO: why don't these autolayout constraints work?
 //        appInitialViewSnapshot.translatesAutoresizingMaskIntoConstraints = false
 //        appInitialViewSnapshot.anchorConstraintsToFitSuperview()
-        appInitialViewSnapshot.frame = CGRect(origin: .zero, size: appIconImageView.bounds.size)
+        appIconContainerView.addSubview(appInitialViewSnapshot)
+        appInitialViewSnapshot.frame = appIconContainerView.bounds
         appInitialViewSnapshot.autoresizingMask = [.flexibleHeight, .flexibleWidth]
         appInitialViewSnapshot.alpha = 0
         

        // directly by using UIView animation mechanisms
        let startRadius = reversed ? 0 : startingCornerRadius
        let endRadius = reversed ? startingCornerRadius : 0
        appInitialViewSnapshot.layer.cornerRadius = endRadius
        let animation = CABasicAnimation(keyPath: #keyPath(CALayer.cornerRadius))
        animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
        animation.fromValue = startRadius
        animation.toValue = appInitialViewSnapshot.layer.cornerRadius
        animation.duration = duration
        appInitialViewSnapshot.layer.add(animation, forKey: "cornerRadius")
    }
    
    func snapshotImageForZoomingAppIcons(from viewController: SpringBoardViewController) -> UIImage {

                })
                
                UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 1.0, animations: {
                    appIconContainerView.frame = finalFrame
                    appCollectionSnapshotView.alpha = 0
                    appCollectionSnapshotView.transform = CGAffineTransform(scaleX: self.otherAppZoomScale, y: self.otherAppZoomScale)
                    wallpaperSnapshotView.transform = CGAffineTransform(scaleX: self.wallpaperZoomScale, y: self.wallpaperZoomScale)
                })
                }, completion: { _ in
                    toView.isHidden = false
                    appIconContainerView.removeFromSuperview()
                    appInitialViewSnapshot.removeFromSuperview()
                    appIconImageView.removeFromSuperview()
                    appCollectionSnapshotView.removeFromSuperview()
