From f7dbf214992ea68a31a4db8a30cef72df58123cd Mon Sep 17 00:00:00 2001 From: nixzhu Date: Fri, 15 May 2015 18:24:29 +0800 Subject: [PATCH] image nil --- .../ProfileSocialAccountImagesCell.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift index e55662e9..7563590e 100644 --- a/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift +++ b/Yep/Views/Cells/ProfileSocialAccount/ProfileSocialAccountImagesCell.swift @@ -21,15 +21,22 @@ class ProfileSocialAccountImagesCell: UICollectionViewCell { if shots.count > 0 { let shot = shots[0] imageView1.kf_setImageWithURL(NSURL(string: shot.images.teaser)!) + } else { + imageView1.image = nil } if shots.count > 1 { let shot = shots[1] imageView2.kf_setImageWithURL(NSURL(string: shot.images.teaser)!) + } else { + imageView2.image = nil } + if shots.count > 2 { let shot = shots[2] imageView3.kf_setImageWithURL(NSURL(string: shot.images.teaser)!) + } else { + imageView3.image = nil } case .Instagram(let instagramWork): @@ -38,15 +45,22 @@ class ProfileSocialAccountImagesCell: UICollectionViewCell { if medias.count > 0 { let media = medias[0] imageView1.kf_setImageWithURL(NSURL(string: media.images.thumbnail)!) + } else { + imageView1.image = nil } if medias.count > 1 { let media = medias[1] imageView2.kf_setImageWithURL(NSURL(string: media.images.thumbnail)!) + } else { + imageView2.image = nil } + if medias.count > 2 { let media = medias[2] imageView3.kf_setImageWithURL(NSURL(string: media.images.thumbnail)!) + } else { + imageView3.image = nil } } }