Deleted row in tableView hide a second tableView in the same controller

58 Views Asked by At

I've an UITableViewController within an UITableView(named: AutocompleteTableView) that appears only when i'm editing a textfield in the UITableViewController.

I draw UITableView(AutoCompleteTableView) looking for the coordinates for the second section of my UITableViewController.

I'm scrolling the UITableViewController to the second section with :

self.tableView.scrollToRowAtIndexPath(NSIndexPath(forRow: self.tableView.numberOfRowsInSection(1) - 1, inSection:
        1), atScrollPosition: UITableViewScrollPosition.Top, animated: true)

After scrolled the UITableViewController I draw the coordinates for the UITableView(AutoCompleteTableView) with :

autocompleteTableView.frame = CGRectMake(0, self.tableView.rectForSection(1).maxY, self.view.frame.width, (self.tableView.contentSize.height - self.tableView.rectForSection(1).maxY))

So, when I started writing in the textfield, the AutocompleteTableView appears in the correct position, but when I deleted a row from this section, the AutoCompleteTableView never again appears while I start to writing in the TextField.

I'm calling the two funcs (Scroll, and Draw) in the textfieldShouldChangeCaracter func.

0

There are 0 best solutions below