类似qq聊天的效果。每发一条信息,tableview更新cell并且显示最后一个cell
- func tableView(tableView: UITableView,cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell
- var sectionCount:Int = self.tableViewMessInfo.numberOfSections()
- if(sectionCount != 0) {
- var rowCount = self.tableViewMessInfo.numberOfRowsInSection(0)
- if(rowCount != 0)
- {
- println("\\\\\\\\\\\\\\\\\\")
- var ii = [0,rowCount - 1]
- var indexPath = NSIndexPath(indexes: ii,length: ii.count)
- self.tableViewMessInfo.scrollToRowAtIndexPath(indexPath,atScrollPosition: UITableViewScrollPosition.Bottom,animated: true)
- }
- }
- return cell
- }