Итак, я пытаюсь установить 3 разных ячейки tableView в UITableView с разной высотой для каждой ячейки. Мне интересно, как мне вернуть 3 разные ячейки, каждая со своей собственной высотой?
Спасибо за подсказки или помощь!
// MARK: - Table view data source
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 3
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if(section == 0) {
return 1
}
if(section == 1) {
return 1
}
else {
return 10
}
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
switch indexPath.section{
case 0:
let myProfile = tableView.dequeueReusableCellWithIdentifier("ProfileHeaderCell") as! VideoTableViewCell
return myProfile
case 1:
let myInfo = tableView.dequeueReusableCellWithIdentifier("AlbumCell") as! AlbumTableViewCell
return myInfo
default:
let cell = tableView.dequeueReusableCellWithIdentifier("TravelBookCell") as! TravelBookTableViewCell
return cell
}
}