title: Keep getting an error when showing or hiding rows using segmented control- Eureka
body: <p>I'm using a segmented control to hide or show rows and I keep getting an error.</p>
  <p>The error:
  Eureka/Section.swift:247: Fatal error: Section: Index out of bounds.</p>
  <p>The code:</p>
  <pre><code>func drop() {
          global.communityTitle = &quot;Posting&quot;
          global.containerHeight.constant = screenSize.height/1.4
          tableView.isScrollEnabled = true
          form = Section()
          
          &lt;&lt;&lt; SegmentedRow&lt;String&gt;(&quot;type&quot;){
              $0.options = [&quot;Hiring&quot;, &quot;Looking for work&quot;]
              $0.value = &quot;Hiring&quot;
          } .onChange { [unowned self] (row) in
              tableView.reloadData()
          }
          +++ Section(){
              $0.tag = &quot;Hiring&quot;
              $0.hidden = &quot;$type != 'Hiring'&quot;
      }
          &lt;&lt;&lt; TextRow(){
              $0.title = &quot;Job Title&quot;
              $0.placeholder = &quot;Enter text here&quot;
              $0.add(rule: RuleRequired())
              $0.validationOptions = .validatesOnChangeAfterBlurred
              $0.hidden = &quot;$type != 'Hiring'&quot;
          } .cellUpdate { cell, row in
              if !row.isValid {
                  cell.titleLabel?.textColor = .systemRed
              }
          }
          +++ Section(){
              $0.tag = &quot;Looking for work&quot;
              $0.hidden = &quot;$type != 'Looking for work'&quot;
          }
          &lt;&lt;&lt; TextRow(&quot;Posting Title&quot;){
              $0.title = $0.tag
              $0.placeholder = &quot;Enter text here&quot;
              $0.add(rule: RuleRequired())
              $0.validationOptions = .validatesOnChangeAfterBlurred
          } .cellUpdate { cell, row in
              if !row.isValid {
                  cell.titleLabel?.textColor = .systemRed
              }
          }
  </code></pre>
  <p>I think it is either of both of these lines of code:</p>
  <pre><code>        global.containerHeight.constant = screenSize.height/1.4
          tableView.isScrollEnabled = true
  </code></pre>
  <p>Every time I remove them, the code works. But I want them in the code. Any ideas why this is crashing my app?</p>
  <p><a href="https://github.com/xmartlabs/Eureka/issues/2217#issue-1205744831" rel="nofollow noreferrer">Eureka error in hiding/showing rows</a></p>