Skip to content

Instantly share code, notes, and snippets.

@patrykpoborca
Created November 2, 2015 03:08
Show Gist options
  • Select an option

  • Save patrykpoborca/e2cddf2d2e07ce716a45 to your computer and use it in GitHub Desktop.

Select an option

Save patrykpoborca/e2cddf2d2e07ce716a45 to your computer and use it in GitHub Desktop.
@objc func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let userCell = tableView.dequeueReusableCellWithIdentifier("user", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! GithubUserCell;
if let unwrapped = users {
let user = unwrapped[indexPath.row];
userCell.userName.text = user.login;
userCell.imageView?.image = nil;
ImageLoader.load(NSURL(string: user.imageUrl!)!).completionHandler{ (u : NSURL, i : UIImage?, e : NSError?, c : CacheType) -> Void in
userCell.imageView?.image = i;
};
}
return userCell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment