HenrikSwahn / DV1431

0 stars 0 forks source link

Handle actions for "Insert" and "Delete" in WishListTableViewController #2

Closed devinant closed 8 years ago

devinant commented 8 years ago

This requires Core Data for WishListItem class (declared in WishListTableViewController) as described in #3. Affected function:

func wishAction(action sheet: WishAction) -> (action: UITableViewRowAction, indexPath: NSIndexPath) -> Void {
    return { [unowned self] (action, indexPath) in
        /// ...

        switch sheet {
        case .Insert:
            // Insert this item to the main library
            controller.addActions(self.defaultAlertActions(.Destructive) { _ in
                /// Handle this case
            })

        case .Delete:
            // Delete this item from the wish list
            controller.addActions(self.defaultAlertActions(.Default) { [unowned self] _ in
                /// Handle this case
             })
        }

        /// ...
    }
}
devinant commented 8 years ago

Partially done, look at #6