Tuesday, June 30, 2026
HomeiOS Developmentios - CoreAnimation CATransform3DScale hides a UIView

ios – CoreAnimation CATransform3DScale hides a UIView

[ad_1]

I’m making an attempt to make a view have the impact of coming out of the display screen. Nonetheless, every time I attempt to use CATransform3DScale, the view disappears. I’ve tried adjusting with the zPosition, however that has not labored. I’m utilizing ‘TheAnimation’ from cocoapods. I can not appear to discover a answer to this downside.

personal func setupAnimation(){
        var remodel = CATransform3DIdentity
        remodel.m34 = -1.0/500.0
        //containerViews[0].layer.anchorPoint = CGPoint(x: 0.0, y: 0.0)
        containerViews[0].layer.zPosition = CGFloat(Float.greatestFiniteMagnitude)
        remodel = CATransform3DScale(remodel, 0, 0, 1)
        let animation = BasicAnimation(keyPath: .remodel)
        animation.fromValue = CATransform3DIdentity
        animation.toValue = remodel
        animation.period = 3.0
        animation.setAnimationDidStop { _ in
            print("whats up")
            self.containerViews[0].layer.zPosition = 0
        }
        animation.animate(in: containerViews[0].layer)
    }

View disappears after which reappears after the animation period.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments