01 - Preheat the oven to 350°F. Grease an 8-inch round cake pan and line with parchment paper.
02 - Whisk together the flour, baking powder, cinnamon, nutmeg, and salt in a large bowl.
03 - Rub the cold butter into the flour mixture with fingertips until coarse crumbs form.
04 - Stir the granulated sugar into the butter-flour mixture.
05 - Whisk together eggs, milk, and vanilla extract in a separate bowl.
06 - Pour the wet ingredients into the dry mixture and stir until just combined, avoiding overmixing.
07 - Gently fold the sliced apples into the batter.
08 - Transfer batter to the prepared pan, smooth the top, and sprinkle with demerara or granulated sugar.
09 - Bake for 45 to 50 minutes until a skewer inserted into the center comes out clean and the top is golden brown.
10 - Let cool in the pan for 10 minutes, then transfer to a wire rack.
11 - Heat milk in a saucepan over medium heat until just simmering, without boiling.
12 - Whisk together egg yolks, sugar, cornstarch, vanilla, and salt until smooth.
13 - Slowly pour the hot milk into the egg mixture while whisking constantly.
14 - Return the mixture to the saucepan and cook over low heat, stirring constantly until thickened enough to coat the back of a spoon, about 5 to 7 minutes. Do not let it boil.
15 - Remove from heat and serve warm custard alongside slices of apple cake.