First start with the pineapple jam at least a day ahead. Place the fresh pineapple on cutting board. Cut to remove the top stem and bottom, then trim and remove the skin. Next remove the eyes. Cut the pineapples into quarters lengthwise. Remove the cores and cut into small chunks. You should have about 4 cups of pineapples.
In a medium saucepan, add pineapple, ½ cup sugar (not all) and 2 tablespoons water (not all). Bring to a boil over medium heat. Once boiling, reduce to medium-low heat, cook for 30 minutes, stirring occasionally. Remove from heat and cool for 15 minutes.
Transfer the pineapples with juice to a blender. Add 5 tablespoons water. Blend until pretty smooth. Pour back to the saucepan. Taste and adjust with more sugar if needed (I added ½ cup). Cook over medium-low heat until little bit of liquid remained and the color of the pineapple has darkened a little, about 15 minutes, stirring often. The jam should be easily spreadable. Set aside to cool to room temperature. Transfer to an airtight container and keep in the fridge for overnight or up to 2 weeks. Keep in mind that jam will thicken a bit more when cooled. (Not all the jam will be used for the ice cream. There will be leftover.)
For the ice cream, start with toasted coconut. In a medium saucepan over medium-low heat, add the shredded coconut. Stir and toast until deeply golden brown, about 5 minutes, stirring constantly. Remove from heat. Scoop out ¼ cup toasted coconut to a plate to cool down. When cooled, transfer to a small Ziploc bag. This will be used as topping later.
In the meantime, keep the rest of the coconut in the saucepan, add coconut milk, heavy cream, whole milk, sugar and salt. Cook over medium-low heat until the mixture is simmering and sugar has dissolved. Remove from heat.
In a large mixing bowl, whisk the egg yolks until pale, about 2 minutes. While whisking, slowly pour 1/3 of hot cream into the yolks. Then whisk the yolk mixture back into the saucepan with the cream. Cook over medium-low heat until the mixture is thick enough to coat the back of a wooden spoon (170˚F on an instant thermometer), stirring constantly. Remove from heat and let steep for 1 hour (without lid).
Strain the mixture through a fine-mesh sieve into a large bowl. Using a wooden spoon, press down on the coconut to squeeze out all the liquid. It should be about 3 cups of mixture. Discard the coconut. Let the mixture cool to room temperature. Cover and refrigerate until completely chilled, about 4 hours or overnight.
When ready to churn the ice cream, pour the mixture into an ice-cream maker by following the ice-cream maker instruction. Transfer 1/3 of ice cream into a container. Add 1/3 of pineapple jam and stir with a spoon to make swirls. It doesn’t need to mix well. Add another 1/3 of ice cream and 1/3 of pineapple jam, do another round of swirls. Spoon the rest of the ice cream into the container and the last 1/3 of jam. Swirl a couple more times. Cover and freeze for at least 4 hours before serving.
Scoop ice cream to serving bowls and sprinkle some reserved toasted coconut on top. Serve immediately.