Skip to content

Instantly share code, notes, and snippets.

@BalestraPatrick
Created February 10, 2016 16:52
Show Gist options
  • Save BalestraPatrick/ad02b9586dbbc614cd2f to your computer and use it in GitHub Desktop.
Save BalestraPatrick/ad02b9586dbbc614cd2f to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
dataSource.configureCell = { table, indexPath, user in
let cell = table.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
let string = "\(user.screenName) is following \(user.followingCount) users and is followed by \(user.followersCount) users."
cell.textLabel?.text = string
cell.textLabel?.numberOfLines = 0
cell.backgroundColor = indexPath.row % 2 == 0 ? UIColor.whiteColor() : UIColor(red: 0, green: 0, blue: 0, alpha: 0.05)
return cell
}
viewModel.getUsers()
.bindTo(tableView.rx_itemsWithDataSource(dataSource))
.addDisposableTo(disposeBag)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment