title: Programmatically switch UITableView in UITableViewController
body: <p>NOTE: I know this is a re-post; I posted the same question a few days ago sans-code and, understandably, it was closed. I edited the question to add some relevant snippets but the question was not reopened, so I am reposting here. If this isn't the proper way to do this, let me know!</p>
  
  <p>I have an application with two modes, and the settings screen is slightly different for each mode (one additional section in one of them, a few differences in number of rows, different UserDefaults keys, etc.). In the past I implemented this with a crapton of switch and if statements, but in an effort to make things more maintainable I'm investigating ways on splitting the two modes into their own separate classes of something. Initially I considered making two separate <code>UITableViewController</code> subclasses, however I was having trouble thinking of how that would work with storyboards and such. I then thought to use two separate <code>UITableView</code> subclasses, and select which one to show based on the mode in <code>viewDidLoad</code>.</p>
  
  <p>However, I'm having issues with this approach. I have it set up so that the controller's <code>cellForRow</code> method calls the TableView's <code>cellForRow</code> method, but that's where things break. When trying to do a <code>dequeueReusableCell</code>, the app crashes with the ever vague "<code>EXC_BAD_INSTRUCTION</code>" error on that line.</p>
  
  <p>Here's some relevant code:</p>
  
  <p><strong>ViewController.swift</strong></p>
  
  <pre><code>...
  override func viewDidLoad()
  {
      super.viewDidLoad()
  
      ...
  
      tableView = SRScaleSettingsTableView()
  }
  ...
  override func tableView(_ tableView: UITableView?, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell
  {
      return (tableView?.cellForRow(at: indexPath))!
  }
  </code></pre>
  
  <p><strong>SRScaleSettingsTableView.swift</strong></p>
  
  <pre><code>override func cellForRow(at indexPath: IndexPath) -&gt; UITableViewCell?
  {
      ...
          switch indexPath.section
          {
          case 0:
              ...
              let switchCell = dequeueReusableCell(withIdentifier: "SwitchCell") as! SRSwitchCell     
              ^ Debugger breaks on that line with EXC_BAD_INSTRUCTION
              ...
  
              return switchCell
          ...
          }
  }
  </code></pre>
  
  <p>Any ideas on what would cause this? Is my approach even correct; is there a better way to do this?</p>