Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Created January 19, 2018 09:51
Show Gist options
  • Save Otbivnoe/83f25ba8ed5efb4ccb5b341506ea86ac to your computer and use it in GitHub Desktop.
Save Otbivnoe/83f25ba8ed5efb4ccb5b341506ea86ac to your computer and use it in GitHub Desktop.
protocol ProfileRoute {
func openProfile(for user: User)
}
extension ProfileRoute where Self: UIViewController {
func openProfile(for user: User) {
let profileViewController = ProfileViewController(user: user)
present(profileViewController, animated: true, completion: nil)
}
}
final class FriendsViewController: UIViewController, ProfileRoute {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment