Created
February 10, 2016 16:52
-
-
Save BalestraPatrick/ad02b9586dbbc614cd2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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