Skip to content

Instantly share code, notes, and snippets.

@prostakm
Created November 16, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prostakm/cbab713adc776c60a5e681c2eb031040 to your computer and use it in GitHub Desktop.
Save prostakm/cbab713adc776c60a5e681c2eb031040 to your computer and use it in GitHub Desktop.
protocol View: class {
func show(data: String)
}
class ViewController: UIViewController, View {
let presenter: Presenter
var label: UILabel!
init(presenter: Presenter) {
self.presenter = presenter
super.init(nibName: nil, bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func show(data: String) {
label.text = data
}
override func viewDidLoad() {
super.viewDidLoad()
presenter.viewLoaded()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment