I have a table. In her custom cell. In each cell there is an ImageView for avatars. Avatar is loaded from the Internet. To upload avatars to this view I use the following code:
cell.avatarIMG.layer.cornerRadius = cell.avatarIMG.frame.height / 2 cell.avatarIMG.clipsToBounds = true let imgURL: NSURL = NSURL(string: post.useravatar!)! let imgData: NSData = NSData(contentsOfURL: imgURL)! cell.avatarIMG.image = UIImage(data: imgData) When the screen with the table loads, I get the data, then I reload the table and the data is displayed on the screen. All the rules, but first avatars without pictures. But it is worth scrolling down, then all the rules. And if you go back to the beginning there, too, all the rules, avatars all work and there are pictures. By the method of typing, I found out that if I remove the line from the code:
cell.avatarIMG.clipsToBounds = true Everything is working fine. But with this row, the pictures appear only after the cell is reused.
What is most interesting, in the seventh version of xcode this problem was not. It appeared only after upgrading to version 8.
UPD: while writing a question, in parallel, google, that the problem is in the bug of the eighth xcode. When I request the height of the imageview frame, 1000.0 is returned to me, as a result, the wrong radius is calculated, and this results in a display problem. And after the cell is reused, the size is already correct, which is why the radius becomes correct and the image is displayed.
But then how to get the right height of the ImageView?