     return self.sections.first?.rows[row].name
   }
 }
+
+// MARK: - PHPickerViewControllerDelegate
+@available(iOS 14.0, *)
+extension PickerTableViewController: PHPickerViewControllerDelegate {
+  func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
+    dismiss(animated: true, completion: nil)
+  }
+}

// Copyright © 2020 Itty Bitty Apps. All rights reserved.

import UIKit

final class PickerTableViewController: UITableViewController {
  private enum Section: CaseIterable {
    case datePicker
    case colorPicker
    case other
  }

  private let sections: [CountrySection] = RevertItems.capitalCities.data()
  private let datePickerCellIdentifier = "DatePickerCell"
  private let tableViewCellIdentifier = "UITableViewCell"

  private var pickerSections: [Section] {
    if #available(iOS 14.0, *) {
      return [.datePicker, .colorPicker, .other]
    }
    return [.datePicker, .other]
  }

  @available(iOS 14, *)
  var datePickerStyles: [UIDatePickerStyle] { [.compact, .inline, .wheels] }

  override func viewDidLoad() {


  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    if #available(iOS 14.0, *) {
      switch pickerSections[section] {
      case .datePicker:
        return self.datePickerStyles.count
      case .iOS14Picker:
        return tableViewCelllabels.count
      default:
        return 1
      }
    }
    return 1
  }
