Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Update demo project optional unwrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko committed Dec 7, 2015
1 parent 29bb9fd commit 8e7f14f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ import ParseUI
class CustomProductTableViewController: PFProductTableViewController {

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let product = objects?[indexPath.row] as? PFObject
let product = objects?[indexPath.row]
if let identifier = product?["productIdentifier"] as? String where identifier == "Cooper" {
PFPurchase.buyProduct(identifier) { error in
if error == nil {
UIAlertView(title: "Success!", message: "Yes!", delegate: nil, cancelButtonTitle: "OK").show()
}
}
return
}
super.tableView(tableView, didSelectRowAtIndexPath: indexPath)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SectionedTableViewController: PFQueryTableViewController {
super.objectsDidLoad(error)

sections.removeAll(keepCapacity: false)
if let objects = objects as? [PFObject] {
if let objects = objects {
for object in objects {
let priority = (object["priority"] as? Int) ?? 0
var array = sections[priority] ?? Array()
Expand Down

0 comments on commit 8e7f14f

Please sign in to comment.