Good day! In advance, here is the project on GitHub: https://github.com/megas781/Civilia

Such a problem: when downloading an image from a file using NSKeyedUnarchiver (i.e. when downloading an application), it rotates based on its “source” orientation. Although when I load an image into a cell from another image (see the AddCMViewController.createButtonTapped method), everything is fine. How to make so that when loading from a file the image is displayed correctly? How would you solve this problem?

enter image description here

    1 answer 1

    There was a similar problem when uploading pictures via API. I solved it very simply - turned the image 90 degrees. Here is an example code -

     ImageView.transform = ImageView.transform.rotated(by: CGFloat(M_PI_2)