I have a list of numbers in a table view like this.

As you can see th
Do this to find the first element in the array that is equal to groupNoToScroll. Then, go to that row.
var rowToGoTo:Int = 0 //Rather use the Swift find function.
for x in items{
if x == groupNoToScroll{
break
}
rowToGoTo++
}
let lastRow = tableView.indexPathsForVisibleRows()?.last as NSIndexPath
if indexPath.row == lastRow.row {
if scrollToTime == true {
let indexPath = NSIndexPath(row: rowToGoTo, section: 0)
tblBusList.scrollToRow(at: indexPath as IndexPath, at: .top, animated: true)
}
}
But I would recommend doing this in viewDidAppear.
As Isuru pointed out rather use the find function.