From 6d2bdb06f818fa9a6892a56c751335324ed62da2 Mon Sep 17 00:00:00 2001 From: Tom Fox Date: Wed, 13 Mar 2019 10:42:14 +0000 Subject: [PATCH] Update user-interface.md --- _includes/ios/user-interface.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/_includes/ios/user-interface.md b/_includes/ios/user-interface.md index d44c30cf7..c7692b722 100644 --- a/_includes/ios/user-interface.md +++ b/_includes/ios/user-interface.md @@ -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! } ```