Question: I'm working on a dynamic calendar that allows user to click on individual days to change whether they're available or unavailable. It works as it's supposed to up until I select another month or year. Once that happens the "click" event on individual cells/days doesn't work. 

```
// Changes cell background of the calendar
var changeColor = function(temp) {
// if cell background is white -> change to green
if(temp.css('background-color') == "rgba(0, 0, 0, 0)") {
    temp.css('background-color', 'green');
    // if cell background is green -> change to red
} else if (temp.css('background-color') == "rgb(0, 128, 0)") {
    temp.css('background-color', 'red');
} else {
    // else change back to white
    temp.css('background-color', '');
}
};

```

Here is were it's used 

```
$(document).ready(function() {
// When a date-cell is clicked - changes color to green -> red -> white
$(".calCell:not(.empty)").click(function() {
    changeColor($(this));
});

});

```

The two buttons that change the whole calendar to red or green seem to work fine with each month selected. 

```
// When Available button is click -> changes whole calendar to available
$("#yes").on("click", function() {
    $(".calCell:not(.empty)").css('background-color', 'green');
});

// When Unavailable button is clicked -> changes whole calendar to unavailable
$("#no").on("click", function() {
    $(".calCell:not(.empty)").css('background-color', 'red');
});

```

Example: 
[JS Fiddle](https://jsfiddle.net/x2bmd8y5/4/#&togetherjs=QgwrIUjyjV)

Answer: 
I believe all you need to do is create an array of images like you are with the title and subtitle. When you add another picture, add the image name to the array and append the tableView. 

What I see in your code is a name and position. It looks like you need to add "image" and set it to the name of the image. For example, `MyWhatsit(name: "Bob Smith", position: "midfielder", image: "bobSmithImage")`... and then you set the cell's image view equal to the image name.

Hope this gets you moving!
You need to create your own personal category. For example sorting your players based on positions they play. Using a class that stores your images into an array. For example:

```
let goalkeeper = [UIImage(named:"ivanlucic"), UIImage(named:"manuelneuer")]
let rightBack = [UIImage(named:"danialves"), UIImage(named:"sergioramos")]

```

After you have a list of images, inside your `cellForRowAtIndexPath` you can do a checking, and reference it to the array your created.