I have UITableViewControllerwith UIImageView. The content is loaded with the following simple code.
@IBOutlet weak var avatarImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
updateUI()
}
func updateUI() {
backendless.userService.currentUser.retrieveProperties()
avatarImageView.layer.cornerRadius = avatarImageView.frame.size.width/2
avatarImageView.layer.masksToBounds = true
let imgURL = NSURL(string: (backendless.userService.currentUser.getProperty("Avatar") as? String)!)
avatarImageView.sd_setImageWithURL(imgURL)
tableView.reloadData()
}
ImageView does not appear.
But if I remove the following code, the UIImageView will be correctly installed and displayed.
avatarImageView.layer.cornerRadius = avatarImageView.frame.size.width/2
avatarImageView.layer.masksToBounds = true
What am I missing? Help is much appreciated .:
PS:
Xcode 8.0
Swift 2.3
The contours for ImageView are set to 120 * 120
sd_setImageWithURL= pod 'SDWebImage'

source
share