Guest User

Untitled

a guest
Oct 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. var imgListArray:[UIImage]?
  2.  
  3. for image in (news?.images)! {
  4.  
  5. if let url = URL(string: image) {
  6. if let data = try? Data(contentsOf: url) {
  7. if(imgListArray == nil) {
  8. imgListArray = [UIImage(data: data)!]
  9. } else {
  10. imgListArray?.append(UIImage(data: data)!)
  11. }
  12.  
  13. }
  14. }
  15. }
  16.  
  17. cell.newsImagesView.image = imgListArray?.first
  18.  
  19. cell.newsImagesView.animationImages = imgListArray;
  20. cell.newsImagesView.animationDuration = 10
  21. cell.newsImagesView.startAnimating()
Add Comment
Please, Sign In to add comment