you have to use this method
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
let lastElement = dataSource.count - 1
if indexPath.row == lastElement {
// handle your logic here to get more items, add it to dataSource and reload tableview
}
}