Commit 751628f7 by Dima Bart

Update customer sample app to adapt to NSOrderedSet.

parent d912be88
...@@ -88,12 +88,12 @@ extension OrdersViewController: UITableViewDataSource { ...@@ -88,12 +88,12 @@ extension OrdersViewController: UITableViewDataSource {
func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? { func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
let order = self.orders[section] let order = self.orders[section]
return "Order total: $\(order.totalPrice) \(order.currency)" return "Order total: $\(order.totalPrice)"
} }
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! LineItemCell let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! LineItemCell
let lineItem = self.orders[indexPath.section].lineItems[indexPath.row] let lineItem = self.orders[indexPath.section].lineItemsArray[indexPath.row]
cell.setLineItem(lineItem) cell.setLineItem(lineItem)
...@@ -106,9 +106,7 @@ extension OrdersViewController: UITableViewDataSource { ...@@ -106,9 +106,7 @@ extension OrdersViewController: UITableViewDataSource {
// //
extension BUYOrder { extension BUYOrder {
var lineItems: [BUYLineItem] { var lineItemsArray: [BUYLineItem] {
var items = self.fulfilledLineItems return self.lineItems.array as! [BUYLineItem]
items.appendContentsOf(self.unfulfilledLineItems)
return items
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment