Skip to content

Instantly share code, notes, and snippets.

@alvareztech
Created November 18, 2016 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvareztech/2f5b94b2b12e59bf24a83c7e750a1809 to your computer and use it in GitHub Desktop.
Save alvareztech/2f5b94b2b12e59bf24a83c7e750a1809 to your computer and use it in GitHub Desktop.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
if indexPath.section == 0 {
self.textFieldTableViewCell = tableView.dequeueReusableCellWithIdentifier("\(self.idFilterTextFieldTableViewCell)", forIndexPath: indexPath) as! FilterTextFieldTableViewCell
self.textFieldTableViewCell.textField.delegate = self
return self.textFieldTableViewCell
} else if indexPath.section == 1 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCellWithIdentifier("\(self.idImageTableViewCell)", forIndexPath: indexPath) as! ImageTableViewCell
if let variableName = self.object {
let auxValue = self.object.fields[indexPath.row].value
let urlImage = Util.extractPhotoUrl(auxValue)
print(" URL>>> " + urlImage)
//cell.imageViewCell.af_setImageWithURL(NSURL(string: urlImage)!)
cell.imageViewCell.sd_setImageWithURL(NSURL(string:urlImage))
return cell
} else {
print("print null")
return nil
}
//return cell
} else {
let cell = tableView.dequeueReusableCellWithIdentifier("\(self.idWorkflowSelectFilterTableViewCell)", forIndexPath: indexPath) as! WorkflowSelectFilterTableViewCell
let field : FieldDataModel = self.object.fieldsCleanOrdered[indexPath.row - 1]
cell.titleLabel.text = field.name
if String(field.type) == Constants.DATE || String(field.type) == Constants.TIMESTAMP {
cell.selectLabel.text = Util.convertTimestampToStringLong(field.value)
} else {
cell.selectLabel.text = field.value
}
return cell
}
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment