     loadCollectionView(menu: [
       "Material Filled Text Field",
       "UI Text Field",
+      "Confirmation Dialog",
       "Autolayout in Custom View",
     ])
   }

    case 1:
      return performUITextField()
    case 2:
      return performCustomLabelWithButton()
    default:
      print("No row is selected")

    self.present(performCustomLabelWithButton(), animated: false, completion: nil)
  }

  @objc func testConfirmationDialog() {
    resetTests()
    self.present(performConfirmationDialog(), animated: false, completion: nil)
  }
}

// An example view with a tableview and a bottom separator.
class ExampleTableSeparatorView: UIView, UITableViewDataSource {

  let ringtones = ["Callisto", "Luna", "Phobos", "Dione"]

  let tableView: UITableView = {
    let tv = AutoSizedTableView()
    tv.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
    tv.separatorStyle = .none
    tv.rowHeight = 40
    return tv
  }()

  init() {
    super.init(frame: .zero)
    setup()
  }

  required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

  func setup() {
    tableView.dataSource = self
    addSubview(tableView)

    let separator = UIView(frame: .zero)
    separator.backgroundColor = UIColor.lightGray.withAlphaComponent(0.5)
    addSubview(separator)

    tableView.translatesAutoresizingMaskIntoConstraints = false
    separator.translatesAutoresizingMaskIntoConstraints = false

    NSLayoutConstraint.activate([
      tableView.topAnchor.constraint(equalTo: self.topAnchor),
      tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
      tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor),
      separator.topAnchor.constraint(equalTo: tableView.bottomAnchor),
      separator.leadingAnchor.constraint(equalTo: self.leadingAnchor),
      separator.trailingAnchor.constraint(equalTo: self.trailingAnchor),
      separator.bottomAnchor.constraint(equalTo: self.bottomAnchor),
      separator.heightAnchor.constraint(equalToConstant: 2),
    ])

    tableView.reloadData()
    let currentRingtone = IndexPath(row: 1, section: 0)
    tableView.selectRow(at: currentRingtone, animated: false, scrollPosition: .top)
  }

  func numberOfSections(in tableView: UITableView) -> Int {
    return 1
  }

  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return ringtones.count
  }

  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
    cell.textLabel?.text = ringtones[indexPath.row]
    cell.indentationWidth = 0
    return cell
  }
}

// A tableview with intrinsic size that matches its content size.
final class AutoSizedTableView: UITableView {
  override var contentSize: CGSize {
    didSet {
      invalidateIntrinsicContentSize()
    }
  }

  override var intrinsicContentSize: CGSize {
    layoutIfNeeded()
    return CGSize(width: UIView.noIntrinsicMetric, height: contentSize.height)
  }
}
