Skip to content

Instantly share code, notes, and snippets.

@MartinMoizard
Last active August 22, 2017 14:43
Show Gist options
  • Save MartinMoizard/ca6f4e5a895c558197ff5861388ec30f to your computer and use it in GitHub Desktop.
Save MartinMoizard/ca6f4e5a895c558197ff5861388ec30f to your computer and use it in GitHub Desktop.
/// TableViewCells
final class TextFieldCell: UITableViewCell {
@IBOutlet weak var nameTextField: UITextField!
}
final class ButtonCell: UITableViewCell {
@IBOutlet weak var validateButton: UIButton!
}
final class GreetingCell: UITableViewCell {
@IBOutlet weak var greetingLabel: UILabel!
}
/// ViewController
final class SayHelloViewController: UIViewController, UITableViewDataSource {
static let cellIdentifiers = [
"TextFieldCell",
"ButtonCell",
"GreetingCell"
]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return TableViewController.cellIdentifiers.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Classic dequeue work
}
private let viewModel = SayHelloViewModel()
private let bag = DisposeBag()
override func viewDidLoad() {
super.viewDidLoad()
bindViewModel()
}
private func bindViewModel() {
// Let's discuss about this
let inputs = SayHelloViewModel.Input(name: 😱😱, validate: 😱😱)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment