Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions _includes/ios/user-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,21 +701,21 @@ Many apps need to display table view cells which contain images stored in the Pa
```
```swift
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let identifier = "cell"
var cell = tableView.dequeueReusableCellWithIdentifier(identifier) as? PFTableViewCell
if cell == nil {
cell = PFTableViewCell(style: .Default, reuseIdentifier: identifier)
}

if let title = object["title"] as? String {
cell!.textLabel.text = title
}
if let thumbnail = object["thumbnail"] as? PFFileObject {
cell!.imageView.image = UIImage(named: "placeholder.jpg")
cell!.imageView.file = thumbnail
}

return cell!
let identifier = "cell"
var cell = tableView.dequeueReusableCell(withIdentifier: identifier) as? PFTableViewCell
if cell == nil {
cell = PFTableViewCell(style: .default, reuseIdentifier: identifier)
}

if let title = object["title"] as? String {
cell!.textLabel.text = title
}
if let thumbnail = object["thumbnail"] as? PFFileObject {
cell!.imageView?.image = UIImage(named: "placeholder.jpg")
cell!.imageView.file = thumbnail
}

return cell!
}
```
</div>
Expand Down