Skip to content

Instantly share code, notes, and snippets.

@piyush23dez
Last active August 1, 2019 19:26
Show Gist options
  • Save piyush23dez/8c6884a3e9e09fe125ce2b3a6d79e0c7 to your computer and use it in GitHub Desktop.
Save piyush23dez/8c6884a3e9e09fe125ce2b3a6d79e0c7 to your computer and use it in GitHub Desktop.
class HomeViewController: UIViewController {
private let user: User
private let apiService: ApiService
private lazy var name = UILabel()
init(user: User, apiService: ApiService) {
self.user = user
self.apiService = apiService
super.init(nibName: nil, bundle: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
name.text = user.name
}
private func handleSignOutButtonTap() {
apiService.signout()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment