Skip to content

Commit 1ee1b2b

Browse files
authored
Update swift snippet for PFTableViewCell (#600)
1 parent 6cb40fd commit 1ee1b2b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

_includes/ios/user-interface.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -701,21 +701,21 @@ Many apps need to display table view cells which contain images stored in the Pa
701701
```
702702
```swift
703703
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
704-
let identifier = "cell"
705-
var cell = tableView.dequeueReusableCellWithIdentifier(identifier) as? PFTableViewCell
706-
if cell == nil {
707-
cell = PFTableViewCell(style: .Default, reuseIdentifier: identifier)
708-
}
709-
710-
if let title = object["title"] as? String {
711-
cell!.textLabel.text = title
712-
}
713-
if let thumbnail = object["thumbnail"] as? PFFileObject {
714-
cell!.imageView.image = UIImage(named: "placeholder.jpg")
715-
cell!.imageView.file = thumbnail
716-
}
717-
718-
return cell!
704+
let identifier = "cell"
705+
var cell = tableView.dequeueReusableCell(withIdentifier: identifier) as? PFTableViewCell
706+
if cell == nil {
707+
cell = PFTableViewCell(style: .default, reuseIdentifier: identifier)
708+
}
709+
710+
if let title = object["title"] as? String {
711+
cell!.textLabel.text = title
712+
}
713+
if let thumbnail = object["thumbnail"] as? PFFileObject {
714+
cell!.imageView?.image = UIImage(named: "placeholder.jpg")
715+
cell!.imageView.file = thumbnail
716+
}
717+
718+
return cell!
719719
}
720720
```
721721
</div>

0 commit comments

Comments
 (0)