title: attempt to insert section 3 but there are only 3 sections after the update
body: <p>I have Tableview with N number of section in which 0,1 sections are fix. that will never deleted from tableview. But from starting of section 2 to N number of sections, it can be deleted or inserted. and from 2nd section to N sections -> Each sections have number of rows also.<br><br>
  I have searching functionality on this 2nd section to N number of sections. <br> Here is the whole code <br> 
  <strong>1. this is the count dic which contain number of row for each sections ["section" : "no of rows"]</strong></p>
  
  <pre><code>self.countDic.updateValue(1, forKey: "0")
  self.countDic.updateValue(0, forKey: "1")
  for i in 0..&lt;arra1.count {
      self.countDic.updateValue(array.count, forKey: "\(i + 2)")//[index : arraylist.count]
  }
  </code></pre>
  
  <p><br><strong>2. Here is the Tableview Methods which return sections and rows</strong> <br></p>
  
  <pre><code>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return countDic["\(section)"]!
  }
  func numberOfSections(in tableView: UITableView) -&gt; Int {
      return countDic.count
  }
  </code></pre>
  
  <p><br><strong>3. Here is the Searching and table reload code</strong><br></p>
  
  <pre><code>func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
  
      let newString = NSString(string: textField.text!).replacingCharacters(in: range, with: string)
  
      if (newString.isEmpty) {
          FilterStr = ""
      } else {
          FilterStr = newString
      }
  
      let namesBeginningWithLetterPredicate = NSPredicate(format: "(title1 CONTAINS[cd] $letter)")
  
      let arr : [Today_ActivityModel] = (Today_Activity_Data as NSArray).filtered(using: namesBeginningWithLetterPredicate.withSubstitutionVariables(["letter": FilterStr])) as! [Today_ActivityModel]
      if FilterStr == "" {
          self.countDic.removeAll()
  
          FilterData.removeAll()
          //self.GetRecordsCityWiseFilter(ArrayList: self.Today_Activity_Data)
      } else {
          if arr.count &gt;= 0 {
  
              FilterData.removeAll()
              //self.GetRecordsCityWiseFilter(ArrayList: arr )
          } else {
  
              self.countDic.removeAll()
  
              FilterData.removeAll()
              //self.GetRecordsCityWiseFilter(ArrayList: self.Today_Activity_Data)
          }
      }
      DispatchQueue.main.async {
          UIView.performWithoutAnimation {
  
              let indexSet = IndexSet(integersIn: 2..&lt;self.TblView.numberOfSections)
              self.TblView.reloadSections(indexSet, with: .bottom)
          }
      }
      return true
  }
  </code></pre>
  
  <p>While reloading the table i m getting <strong>attempt to insert section 3 but there are only 3 sections after the update</strong> <br>Can anyone help me how to resolve this?</p>