Skip to content

Instantly share code, notes, and snippets.

@ShoMasegi
Created September 11, 2018 07:52
Show Gist options
  • Save ShoMasegi/849f525055f5add80025b4417a0d170b to your computer and use it in GitHub Desktop.
Save ShoMasegi/849f525055f5add80025b4417a0d170b to your computer and use it in GitHub Desktop.
hatena_WithoutStoryboard_TableView_init
class EventsViewController: UIViewController {
...
private lazy var tableView: UITableView = {
let tableView = UITableView()
tableView.estimatedRowHeight = 50
tableView.rowHeight = UITableViewAutomaticDimension
tableView.backgroundColor = .white
tableView.separatorInset = UIEdgeInsets(top: 0, left: 24, bottom: 0, right: 0)
tableView.separatorColor = .lightGray
talbeView.dataSource = self
tableView.delegate = self
tableView.register(EventTableViewCell.self)
return tableView
}()
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment