 <p>check with this code </p> <pre><code>override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int { if(self.courses.count &gt; 0){ tablecount = self.courses.count } else { tablecount = 0 self.table.reloaddata() } return tablecount } </code></pre>