直接上代码
//这里是用xib创建cell的
messageTableView.registerNib(UINib.init(nibName: "MessageCell", bundle: nil), forCellReuseIdentifier: "MessageCell")
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 18
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MessageCell")
return cell!
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 70
}