我有一个嵌套在集合视图中的表视图,并且我返回3(可能更多将来)集合视图单元格,并且我想知道是否可以在每个视图中呈现不同的内容其中一个收集单元?我附上了一些截图,以更好地理解我正在采取的行动。谢谢。在单个视图中控制多个表视图
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 3
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! UITableViewCell
// Configure the cell...
cell.textLabel?.text = "Homeroom"
cell.detailTextLabel?.text = "8:15 AM - 9:00 AM"
cell.selectionStyle = .None
return cell
}
在您的每个数据源方法和委托方法中使用'tag'和检查标记来区分您的tableviews – xmhafiz