0

I want to rotate a view. Tried different things but can not make it

I use autolayout. As a result I have imageView in the top of the screen with share almost as a square

        func presentPortrait() {
        coverImageView.layer.transform = CATransform3DIdentity
        coverImageView.snp.remakeConstraints { (make) in
        make.leading.trailing.top.equalToSuperview()         
        make.width.equalTo(coverImageView.snp.height).multipliedBy(375.0/211.0)
    }



    func presentLandscape() {               
    coverImageView.layer.transform = CATransform3DMakeRotation(CGFloat(.pi/2), 0.0, 0.0, 1.0)
    coverImageView.snp.remakeConstraints { (make) in
    make.leading.trailing.top.bottom.equalToSuperview()

enter image description here

dsfs
  • 189
  • 1
  • 3
  • 10

0 Answers0