Skip to content

Instantly share code, notes, and snippets.

@ctrevarthen
Last active November 19, 2015 03:38
Show Gist options
  • Save ctrevarthen/f161b391eae8c5420c63 to your computer and use it in GitHub Desktop.
Save ctrevarthen/f161b391eae8c5420c63 to your computer and use it in GitHub Desktop.
ShopQuick - Shopping List Manager - DRY
class ShoppingListManager : ProductManager {
static let sharedInstance = ShoppingListManager()
override init() {
super.init()
self.productsKey = "com.detroitlabs.shopfast.products"
self.loadProductsFromDefaults()
}
func markPurchasedAtIndex(index: Int) {
self.products[index].purchased = true
self.saveProductsToDefaults()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment