Skip to content

Instantly share code, notes, and snippets.

@ctrevarthen
Last active November 19, 2015 03:37
Show Gist options
  • Save ctrevarthen/ece20a5816ff240d31a0 to your computer and use it in GitHub Desktop.
Save ctrevarthen/ece20a5816ff240d31a0 to your computer and use it in GitHub Desktop.
ShopQuick - Shopping List Manager - Is Favorited?
func leftButtonsForProduct(product: Product) -> [UIButton] {
let buttons : NSMutableArray = NSMutableArray()
if self.favoritesManager.isProductFavorited(product) {
buttons.sw_addUtilityButtonWithColor(UIColor(red: 224/255, green: 224/255, blue: 103/255, alpha: 1), title: "Faved")
}
else {
buttons.sw_addUtilityButtonWithBackgroundColor(UIColor.whiteColor(), title: "Fav", titleColor: UIColor.blackColor())
}
buttons.sw_addUtilityButtonWithColor(UIColor(red: 14/255, green: 132/255, blue: 37/255, alpha: 1), title: "$")
return buttons as NSArray as! [UIButton]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment