Perform the following steps:
- Create a new empty Swift file in our Controllers folder and call it BaseTableViewController.swift.
- Inside of our BaseTableViewController.swift file, create a new class that inherits from the UITableViewController and has a requestInput method:
import UIKit class BaseTableViewController: UITableViewController { func requestInput(title: String, message: String, handler: @escaping (String) -> ()) { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) alert.addTextField(configurationHandler: nil) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) alert.addAction(UIAlertAction(title: "Add", style: .default, handler: { (_) ...