Created
November 13, 2015 06:27
-
-
Save soggybag/45604c2771c569a7a049 to your computer and use it in GitHub Desktop.
UITableViewCell accessory view. Using an image for the accessory view.
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
func completeRowAtIndexPath(indexPath: NSIndexPath) { | |
print("Completing row: \(indexPath.row)") | |
let cell = tableView.cellForRowAtIndexPath(indexPath) | |
let todo = array[indexPath.row] | |
todo.completed = !todo.completed | |
if todo.completed { | |
// cell?.accessoryType = .Checkmark | |
let ribbon = UIImage(named: "Ribbon") | |
cell?.accessoryView = UIImageView(image: ribbon) | |
} else { | |
cell?.accessoryType = .None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment