Last active
November 19, 2015 03:40
-
-
Save ctrevarthen/4f3e15c0635847e3e158 to your computer and use it in GitHub Desktop.
ShopQuick - ShoppingListVC with SWTableViewCell Delegate methods - actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum LeftUtilityButtons: Int { | |
case Purchase | |
case Favorite | |
} | |
enum RightUtilityButtons: Int { | |
case Delete | |
} | |
// MARK: SWTableViewCell Delegate Methods | |
func swipeableTableViewCell(cell: SWTableViewCell!, didTriggerLeftUtilityButtonWithIndex index: Int) { | |
switch index { | |
case LeftUtilityButtons.Favorite.rawValue: | |
if let indexPath = self.shoppingListTableView.indexPathForCell(cell) as NSIndexPath! { | |
// TODO: Add Favorites functionality here | |
} | |
case LeftUtilityButtons.Purchase.rawValue: | |
if let indexPath = self.shoppingListTableView.indexPathForCell(cell) as NSIndexPath! { | |
// TODO: Add Purchased functionality here | |
} | |
default: | |
break | |
} | |
} | |
func swipeableTableViewCell(cell: SWTableViewCell!, didTriggerRightUtilityButtonWithIndex index: Int) { | |
switch index { | |
case RightUtilityButtons.Delete.rawValue: | |
if let indexPath = self.shoppingListTableView.indexPathForCell(cell) as NSIndexPath! { | |
// TODO: Move Delete functionality here | |
} | |
default: | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment