Skip to content

Commit

Permalink
Merge commit 'f3ed634ee50ff602cf1bca0e8117393cb073fa77' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
devrel-build committed May 16, 2017
2 parents a63ef90 + f3ed634 commit 175c1fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ios/objc/FriendlyChatObjC/FCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(n
NSLog(@"Error downloading: %@", error);
return;
}
cell.imageView.image = [UIImage imageWithData:data];
[tableView reloadData];
dispatch_async(dispatch_get_main_queue(), ^{
cell.imageView.image = [UIImage imageWithData:data];
[cell setNeedsLayout];
});
}];
} else {
cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]];
Expand Down
6 changes: 4 additions & 2 deletions ios/swift/FriendlyChatSwift/FCViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ class FCViewController: UIViewController, UITableViewDataSource, UITableViewDele
print("Error downloading: \(error)")
return
}
cell.imageView?.image = UIImage.init(data: data!)
tableView.reloadData()
DispatchQueue.main.async {
cell.imageView?.image = UIImage.init(data: data!)
cell.setNeedsLayout()
}
}
} else if let URL = URL(string: imageURL), let data = try? Data(contentsOf: URL) {
cell.imageView?.image = UIImage.init(data: data)
Expand Down

0 comments on commit 175c1fa

Please sign in to comment.