Skip to content

Instantly share code, notes, and snippets.

@alvareztech
Last active November 17, 2016 14:54
Show Gist options
  • Save alvareztech/423dcb39001a38d444eaec24f50badf6 to your computer and use it in GitHub Desktop.
Save alvareztech/423dcb39001a38d444eaec24f50badf6 to your computer and use it in GitHub Desktop.
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
bool hasImage = false;
for item in self.object.fields {
if String(item.type) == Constants.IMAGE {
hasImage = true
}
}
switch indexPath.section{
case 1:
if indexPath.row == 0 {
if (hasImage) {
return 200.0
} else {
return 0.0
}
} else {
return 44.0
}
default:
return 44.0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment