 import UIKit
 import CoreData
 
-public class UITableViewFetchedResultsController<Result: NSFetchRequestResult>: UITableViewController, NSFetchedResultsControllerDelegate {
+/// The controller cannot use Swift generics. Subclasses will still be able to
+/// inherit from a generic class but Interface Builder will not be able to find
+/// the subclass by name when instantiating a storyboard. For this reason, the
+/// class uses the basic `NSFetchRequestResult` protocol for the fetch result
+/// type which in turn inherits from `NSObjectProtocol`, and hence just
+/// represents some basic `NSObject`.
+open class UITableViewFetchedResultsController: UITableViewController, NSFetchedResultsControllerDelegate {
 
   /// Use `prepareForSegue` to propagate the managed-object context. The
   /// controller needs one.

  // recurse. Configure the cell and send back the height of the compressed
  // fitting size. This relies on an explicit preferred width and constraints
  // properly set up. If there are no constraints, use the cell's frame height.
  public override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    let cellIdentifier = dataSource.cellIdentifier(forRow: indexPath)
    guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) else {
      return super.tableView(tableView, heightForRowAt: indexPath)

    return dataSource.fetchedResultsController
  }

  open override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return dataSource.tableView(tableView, numberOfRowsInSection: section)
  }

  open override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    return dataSource.tableView(tableView, cellForRowAt: indexPath)
  }

  open override func numberOfSections(in tableView: UITableView) -> Int {
    return dataSource.numberOfSections(in: tableView)
  }

  open override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
    return dataSource.tableView(tableView, titleForHeaderInSection: section)
  }

