Last active
February 10, 2018 15:53
-
-
Save srdanrasic/4dcc75cb62a9dc5045914dfaff661cfc 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
extension ProfileViewController { | |
static func makeViewController(_ userService: UserService) -> ProfileViewController { | |
let viewController = ProfileViewController() | |
viewController.nameLabel.text = userService.user.name | |
viewController.imageView.imageUrl = userService.user.imageUrl // Assuming using an image caching libary | |
userService.friends.bind(to: viewController.friendsView) { cell, friend in | |
cell.nameLabel.text = friend.name | |
} | |
// ... | |
return viewController | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment