 
   // MARK: UITableViewDelegate
   func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-    guard let cell =
-      tableView.dequeueReusableCell(withIdentifier: "MDCDragonsTableViewCell",
-                                    for: indexPath) as? MDCDragonsTableViewCell else {
+    guard
+      let cell =
+        tableView.dequeueReusableCell(
+          withIdentifier: "MDCDragonsTableViewCell",
+          for: indexPath) as? MDCDragonsTableViewCell
+    else {
       return UITableViewCell()
     }
     cell.backgroundColor = .white
-    let nodeData = isSearchActive ? searched[indexPath.item] : cellsBySection[indexPath.section][indexPath.row]
+    let nodeData =
+      isSearchActive ? searched[indexPath.item] : cellsBySection[indexPath.section][indexPath.row]
     let componentName = nodeData.node.title
     cell.textLabel?.text = componentName
     let node = nodeData.node

 limitations under the License.
 */

import CatalogByConvention

import MaterialComponents.MaterialAppBar
import MaterialComponents.MaterialFlexibleHeader
import MaterialComponents.MaterialIcons_ic_chevron_right
import MaterialComponents.MaterialKeyboardWatcher
import MaterialComponents.MaterialLibraryInfo
import MaterialComponents.MaterialShadowElevations
import MaterialComponents.MaterialShadowLayer
import MaterialComponents.MaterialThemes
import MaterialComponents.MaterialTypography
import MaterialComponents.MaterialColorScheme
import MaterialComponents.MaterialContainerScheme

import UIKit

class MDCDragonsController: UIViewController,
                            UITableViewDelegate,
                            UITableViewDataSource,
                            UISearchBarDelegate,
                            UIGestureRecognizerDelegate {

  fileprivate struct Constants {
    static let headerScrollThreshold: CGFloat = 50

  init(node: CBCNode) {
    let filteredPresentable = node.children.filter { return $0.isPresentable() }
    let filteredDragons = Set(node.children).subtracting(filteredPresentable)
    cellsBySection = [
      filteredDragons.map { DragonCell(node: $0) },
      filteredPresentable.map { DragonCell(node: $0) },
    ]
    cellsBySection = cellsBySection.map { $0.sorted { $0.node.title < $1.node.title } }
    super.init(nibName: nil, bundle: nil)
    results = getLeafNodes(node: node)
    searched = results
